首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Json-Viewer: URL中的数据

Json-Viewer: URL中的数据
EN

Stack Overflow用户
提问于 2012-05-30 16:20:01
回答 3查看 8.6K关注 0票数 0

我正在寻找一个在线json查看器,在那里我可以将json-data直接附加到url中。

我编写了一个由应用程序创建的json数据的日志语句,我希望通过单击链接直接查看它会更方便。

所以我希望能找到这样的东西:

代码语言:javascript
复制
http://jsonviewer.stack.hu/#{myJson:data}

谢谢!

EN

回答 3

Stack Overflow用户

发布于 2014-04-01 23:01:09

是的,您可以通过将json数据托管在一个url上并将其传递给jsonviewer.stack.hu来实现。

示例用法:

在这里,json托管在url上。

代码语言:javascript
复制
http://refine.taxonomics.org/gbifchecklists/reconcile?query=Crepidomanes%20minutum

输出

代码语言:javascript
复制
/*
* 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 
* {"result":[{"summary":{"clazz":{"Polypodiopsida":1,"Filicopsida":1},"taxonomicStatus":"ACCEPTED","key":{"111237248":1,"3608345":1},"scientificName":"Crepidomanes minutum (Blume) K. Iwats.","identifiers":{"$VAR1 = [\n          {\n            'identifier' => '819461',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => '9ca92552-f23a-41a8-a140-01abaa31c931',\n            'usageKey' => 111237248,\n            'key' => 12360861\n          }\n        ];\n":1,"$VAR1 = [\n          {\n            'identifier' => '119151859',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => 'd7dddbf4-2cf0-4f39-9b2a-bb099caae36c',\n            'usageKey' => 3608345,\n            'key' => 1947318\n          }\n        ];\n":1},"phylumKey":{"59":1,"107377362":1},"nameType":"WELLFORMED","order":{"Hymenophyllales":1,"Polypodiales":1},"numDescendants":"0","canonicalName":"Crepidomanes minutum","parent":"Crepidomanes","parentKey":{"111237230":1,"6420275":1},"origin":"SOURCE","synonym":"$VAR1 = bless( do{\\(my $o = 0)}, 'JSON::XS::Boolean' );\n","datasetKey":{"9ca92552-f23a-41a8-a140-01abaa31c931":1,"d7dddbf4-2cf0-4f39-9b2a-bb099caae36c":1},"family":"Hymenophyllaceae","classKey":{"107305382":1,"7228684":1},"orderKey":{"7228685":1,"107305408":1},"accordingTo":{"The Catalogue of Life, 3rd January 2011":1},"sourceId":{"819461":1,"119151859":1},"genusKey":{"111237230":1,"6420275":1},"authorship":"K. Iwats. (Blume)","genus":"Crepidomanes","kingdom":"Plantae","nomenclaturalStatus":"$VAR1 = [];\n","species":"Crepidomanes minutum","kingdomKey":{"6":1,"107264512":1},"speciesKey":{"111237248":1,"3608345":1},"familyKey":{"2372":1,"107238235":1},"phylum":"Pteridophyta","rank":"SPECIES","nubKey":"3608345"},"match":false,"name":"Crepidomanes minutum K. Iwats. (Blume) (Plantae)","score":2,"type":["http://www.gbif.org/species/"],"id":111237248},{"summary":{"key":"128412817","scientificName":"Crepidomanes minutum","identifiers":"$VAR1 = [\n          {\n            'identifier' => '484386',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => 'e632b198-5b2f-47ee-b7a6-6531ea435fa3',\n            'usageKey' => 128412817,\n            'key' => 22633798\n          }\n        ];\n","nameType":"WELLFORMED","numDescendants":"0","sourceId":"484386","canonicalName":"Crepidomanes minutum","parent":"Crepidomanes","genusKey":"131300935","authorship":"","parentKey":"131300935","genus":"Crepidomanes","origin":"SOURCE","nomenclaturalStatus":"$VAR1 = [];\n","species":"Crepidomanes minutum","speciesKey":"128412817","synonym":"$VAR1 = bless( do{\\(my $o = 0)}, 'JSON::XS::Boolean' );\n","datasetKey":"e632b198-5b2f-47ee-b7a6-6531ea435fa3","rank":"SPECIES","nubKey":"3608345"},"match":false,"name":"Crepidomanes minutum (Life)","score":1,"type":["http://www.gbif.org/species/"],"id":128412817},{"summary":{"classKey":"106145328","orderKey":"106469758","clazz":"Polypodiopsida","key":"106137798","scientificName":"Crepidomanes minutum","identifiers":"$VAR1 = [\n          {\n            'identifier' => '32127',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => 'fab88965-e69d-4491-a04d-e3198b626e52',\n            'usageKey' => 106137798,\n            'key' => 5892380\n          }\n        ];\n","phylumKey":"106171079","nameType":"WELLFORMED","order":"Hymenophyllales","numDescendants":"0","sourceId":"32127","canonicalName":"Crepidomanes minutum","parent":"Crepidomanes","authorship":"","genusKey":"106112877","parentKey":"106112877","genus":"Crepidomanes","kingdom":"Viridiplantae","origin":"SOURCE","nomenclaturalStatus":"$VAR1 = [];\n","species":"Crepidomanes minutum","kingdomKey":"106147210","speciesKey":"106137798","synonym":"$VAR1 = bless( do{\\(my $o = 0)}, 'JSON::XS::Boolean' );\n","familyKey":"106112824","datasetKey":"fab88965-e69d-4491-a04d-e3198b626e52","phylum":"Streptophyta","rank":"SPECIES","family":"Hymenophyllaceae","nubKey":"3608345"},"match":false,"name":"Crepidomanes minutum (Viridiplantae)","score":1,"type":["http://www.gbif.org/species/"],"id":106137798},{"summary":{"classKey":"116129810","orderKey":"116129818","clazz":"Filicopsida","key":"110817557","scientificName":"Crepidomanes minutum (Blume) K. Iwats., 1985","identifiers":"$VAR1 = [\n          {\n            'identifier' => '205257',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => '1ec61203-14fa-4fbd-8ee5-a4a80257b45a',\n            'usageKey' => 110817557,\n            'key' => 12198868\n          }\n        ];\n","phylumKey":"116129809","nameType":"WELLFORMED","order":"Hymenophyllales","numDescendants":"0","sourceId":"205257","canonicalName":"Crepidomanes minutum","parent":"Crepidomanes","authorship":"K. Iwats., 1985 (Blume)","genusKey":"116129821","parentKey":"116129821","genus":"Crepidomanes","kingdom":"Plantae","origin":"SOURCE","nomenclaturalStatus":"$VAR1 = [];\n","species":"Crepidomanes minutum","kingdomKey":"116127234","speciesKey":"110817557","synonym":"$VAR1 = bless( do{\\(my $o = 0)}, 'JSON::XS::Boolean' );\n","familyKey":"116129819","datasetKey":"1ec61203-14fa-4fbd-8ee5-a4a80257b45a","phylum":"Pteridophyta","rank":"SPECIES","family":"Hymenophyllaceae","nubKey":"3608345"},"match":false,"name":"Crepidomanes minutum K. Iwats., 1985 (Blume) (Plantae)","score":1,"type":["http://www.gbif.org/species/"],"id":110817557},{"summary":{"key":"108671970","scientificName":"Crepidomanes minutum (Blume) K.Iwats.","identifiers":"$VAR1 = [\n          {\n            'identifier' => 'urn:lsid:ipni.org:names:17516350-1',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => '046bbc50-cae2-47ff-aa43-729fbf53f7c5',\n            'usageKey' => 108671970,\n            'key' => 9192285\n          },\n          {\n            'identifier' => 'http://www.ipni.org/ipni/idPlantNameSearch.do?&show_history=true&id=17516350-1',\n            'type' => 'URL',\n            'datasetKey' => '046bbc50-cae2-47ff-aa43-729fbf53f7c5',\n            'identifierLink' => 'http://www.ipni.org/ipni/idPlantNameSearch.do?&show_history=true&id=17516350-1',\n            'usageKey' => 108671970,\n            'key' => 9192284\n          }\n        ];\n","nameType":"WELLFORMED","numDescendants":"0","sourceId":"urn:lsid:ipni.org:names:17516350-1","remarks":"Crepidomanes minutum (Blume) K.Iwats.","canonicalName":"Crepidomanes minutum","link":"http://www.ipni.org/ipni/idPlantNameSearch.do?&show_history=true&id=17516350-1","parent":"Hymenophyllaceae","authorship":"K.Iwats. (Blume)","parentKey":"115219389","nomenclaturalStatus":"$VAR1 = [];\n","origin":"SOURCE","kingdom":"Plantae","species":"Crepidomanes minutum","kingdomKey":"115219148","speciesKey":"108671970","synonym":"$VAR1 = bless( do{\\(my $o = 0)}, 'JSON::XS::Boolean' );\n","familyKey":"115219389","datasetKey":"046bbc50-cae2-47ff-aa43-729fbf53f7c5","rank":"SPECIES","nubKey":"3608345","family":"Hymenophyllaceae"},"match":false,"name":"Crepidomanes minutum K.Iwats. (Blume) (Plantae)","score":1,"type":["http://www.gbif.org/species/"],"id":108671970},{"summary":{"clazz":"Polypodiopsida","taxonomicStatus":"SYNONYM","key":"106797953","scientificName":"Crepidomanes minutum (Blume) K.Iwats.","identifiers":"$VAR1 = [\n          {\n            'identifier' => 'e19935',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => 'fab88965-e69d-4491-a04d-e3198b626e52',\n            'usageKey' => 106797953,\n            'key' => 6544470\n          }\n        ];\n","phylumKey":"106171079","nameType":"WELLFORMED","order":"Hymenophyllales","numDescendants":"0","canonicalName":"Crepidomanes minutum","parent":"Crepidomanes","parentKey":"106112877","origin":"SOURCE","acceptedKey":"106137798","synonym":"$VAR1 = bless( do{\\(my $o = 1)}, 'JSON::XS::Boolean' );\n","datasetKey":"fab88965-e69d-4491-a04d-e3198b626e52","family":"Hymenophyllaceae","classKey":"106145328","orderKey":"106469758","sourceId":"e19935","genusKey":"106112877","authorship":"K.Iwats. (Blume)","genus":"Crepidomanes","kingdom":"Viridiplantae","nomenclaturalStatus":"$VAR1 = [];\n","species":"Crepidomanes minutum","kingdomKey":"106147210","speciesKey":"106137798","familyKey":"106112824","accepted":"Crepidomanes minutum","phylum":"Streptophyta","nubKey":"3608345"},"match":false,"name":"Crepidomanes minutum K.Iwats. (Blume) [=> Crepidomanes minutum] (Viridiplantae)","score":1,"type":["http://www.gbif.org/species/"],"id":106797953},{"summary":{"clazz":"Polypodiopsida","taxonomicStatus":"SYNONYM","key":"126638048","scientificName":"Crepidomanes minutum (Bl.) K. Iwats.","identifiers":"$VAR1 = [\n          {\n            'identifier' => '14239216',\n            'type' => 'SOURCE_ID',\n            'datasetKey' => '7ddf754f-d193-4cc9-b351-99906754a03b',\n            'usageKey' => 126638048,\n            'key' => 20762879\n          },\n          {\n            'identifier' => 'http://www.catalogueoflife.org/annual-checklist/details/species/id/14220376/synonym/14239216',\n            'type' => 'URL',\n            'datasetKey' => '7ddf754f-d193-4cc9-b351-99906754a03b',\n            'identifierLink' => 'http://www.catalogueoflife.org/annual-checklist/details/species/id/14220376/synonym/14239216',\n            'usageKey' => 126638048,\n            'key' => 20762878\n          }\n        ];\n","phylumKey":"127795625","nameType":"WELLFORMED","order":"Hymenophyllales","numDescendants":"0","canonicalName":"Crepidomanes minutum","parent":"Crepidomanes","parentKey":"127934692","origin":"SOURCE","acceptedKey":"126619208","synonym":"$VAR1 = bless( do{\\(my $o = 1)}, 'JSON::XS::Boolean' );\n","datasetKey":"7ddf754f-d193-4cc9-b351-99906754a03b","family":"Hymenophyllaceae","classKey":"127802277","orderKey":"127805044","sourceId":"14239216","link":"http://www.catalogueoflife.org/annual-checklist/details/species/id/14220376/synonym/14239216","genusKey":"127934692","authorship":"K. Iwats. (Bl.)","genus":"Crepidomanes","kingdom":"Plantae","nomenclaturalStatus":"$VAR1 = [];\n","species":"Crepidomanes proliferum","kingdomKey":"127795624","speciesKey":"126619208","familyKey":"127805045","accepted":"Crepidomanes proliferum (Bl.) Bostock","phylum":"Tracheophyta","rank":"SPECIES","nubKey":"3608345"},"match":false,"name":"Crepidomanes minutum K. Iwats. (Bl.) [=> Crepidomanes proliferum (Bl.) Bostock] (Plantae)","score":1,"type":["http://www.gbif.org/species/"],"id":126638048}]}
*/

现在,您可以将JSON源url传递给http://jsonviewer.stack.hu/

http://jsonviewer.stack.hu/#{您的url}

并且最终的url变成

http://jsonviewer.stack.hu/#http://refine.taxonomics.org/gbifchecklists/reconcile?query=Crepidomanes%20minutum

票数 1
EN

Stack Overflow用户

发布于 2012-05-30 16:30:25

我不知道在线观看者,但是你自己写也没什么大不了的,比如用PHP。

使用以下代码创建viewer.php脚本:

代码语言:javascript
复制
if (isset($_GET['json'])) {
    echo '<pre>';
    print_r(json_decode($_GET['json']));
    echo '</pre>';
}

随心所欲地使用它:

代码语言:javascript
复制
http://youserver.com/viewer.php?json={"foo":"bar"}

输出将如下所示:

代码语言:javascript
复制
stdClass Object
(
    [foo] => bar
)
票数 0
EN

Stack Overflow用户

发布于 2015-09-12 20:16:04

这个blinkJ JSON viewer也许可以解决你的问题。您可以通过链接直接共享内容。“共享”按钮就在查看器面板的上方。

请注意,纯JSON字符串不是URL安全的,需要进行编码。

完全公开:我是这个工具的作者,因为我找不到任何在线工具可以轻松地处理50KB的JSON数据。它仍在积极开发中,欢迎通过GitHub提出任何功能请求或问题报告。

希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10812517

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档