编辑和操作JSON的工具?

时间:2012-01-26 15:33:44

标签: json editor

JSON在社交网站中非常受欢迎。

我一直在寻找分析JSON的工具,并找到了一些很好的查看工具,但它们不能满足我的需求。 (如http://jsonviewer.codeplex.com/

我需要按特定的字段搜索和过滤数据,然后从另一个特定字段中获取一些值。

您能否建议一种工具或方法轻松查看我的JSON数据?

示例数据:

{
  "data": [
    {
      "id": "141816652602643",
      "from": {
        "name": "Deval Agrifarman",
        "id": "896085636"
      },
      "message": "yang belum bisa berhenti ngerokok silahkan dilihat... kalo ga bisa donlot mampir aja ke rumah bawa camilan :D",
      "picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQC3wb7_yd8fdv64&w=130&h=130&url=http\u00253A\u00252F\u00252Fi1.ytimg.com\u00252Fvi\u00252FDiyWK3fzTpA\u00252Fhqdefault.jpg",
      "link": "http://www.youtube.com/watch?v=DiyWK3fzTpA",
      "name": "Sex, Lies & Cigarettes': Vanguard Sneak Peek (Indonesia Subtitle-Full)",
      "description": "Fakta mengenai Industri dan bisnis Rokok diIndonesia, Penetrasi Rokok dalam masyarakat Indonesia.. Dalam Konferensi Dunia untuk Tembakau 2010 Koresponden Chr...",
      "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yD/r/aS8ecmYRys0.gif",
      "created_time": "2012-01-26T15:03:21+0000"
    },
    {
      "id": "109379672518544",
      "from": {
        "name": "Deval Agrifarman",
        "id": "896085636"
      },
      "message": "kesannya kok kayak aku yang minta ke monyet nya yah wkwkwkwk...",
      "link": "http://www.facebook.com/photo.php?fbid=107424555941677&set=a.101882006495932.4636.100000224005368&type=1",
      "name": "~KeBaB~",
      "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yD/r/aS8ecmYRys0.gif",
      "created_time": "2012-01-23T15:33:45+0000",
      "comments": {
        "data": [
          {
            "id": "109379672518544_32659",
            "from": {
              "name": "Dhanank Perdhana",
              "id": "1243815675"
            },
            "message": "Deval: \"Mbah, tolong diramal dong garis tangan saya...\"\nMbak Nyemot: \"Hooo.. kamu ini ngga' cocok jadi pejabat.. Nanti kamu pasti pengen cepet2 beli Bentley.. \"\n\n...huehuehue... :P",
            "can_remove": true,
            "created_time": "2012-01-23T15:39:34+0000",
            "likes": 3,
            "user_likes": true
          },
          {
            "id": "109379672518544_32663",
            "from": {
              "name": "Alex Zar",
              "id": "1378608838"
            },
            "message": "klo sodara mmg harus saling berbagi...",
            "can_remove": true,
            "created_time": "2012-01-23T15:42:19+0000"
          },
          {
            "id": "109379672518544_32682",
            "from": {
              "name": "Deval Agrifarman",
              "id": "896085636"
            },
            "message": "Dhanank Perdhana baiklah mbah aku akan jadi pejabat saja... biar punya jaguar... xixixi...\n\nAlex Zar weleh... sodara mu toh? kirain syapa :D xixixi...",
            "message_tags": [
              {
                "id": "1243815675",
                "name": "Dhanank Perdhana",
                "offset": 0,
                "length": 16
              },
              {
                "id": "1378608838",
                "name": "Alex Zar",
                "offset": 92,
                "length": 8
              }
            ],
            "can_remove": true,
            "created_time": "2012-01-23T15:46:13+0000"
          },
          {
            "id": "109379672518544_33010",
            "from": {
              "name": "Ali M. Fauzi",
              "id": "1248947710"
            },
            "message": "\"Seharusnya tangan diatas lebih baik dari tangan dibawah.\" Kira2 klo kondisinya kayak gitu gmn ya? :-) :)",
            "can_remove": true,
            "created_time": "2012-01-23T17:11:03+0000"
          },
          {
            "id": "109379672518544_33012",
            "from": {
              "name": "Ali M. Fauzi",
              "id": "1248947710"
            },
            "message": "\"Seharusnya tangan diatas lebih baik dari tangan dibawah.\" Kira2 klo kondisinya kayak gitu gmn ya? :-) :)",
            "can_remove": true,
            "created_time": "2012-01-23T17:11:17+0000"
          },
          {
            "id": "109379672518544_34880",
            "from": {
              "name": "Deval Agrifarman",
              "id": "896085636"
            },
            "message": "kesannya kayak DPR sekarang... tangannya di atas tapi nyolong dari yang ada di bawah... :D wkwkwkwk...",
            "can_remove": true,
            "created_time": "2012-01-24T03:07:16+0000"
          },
          {
            "id": "109379672518544_35753",
            "from": {
              "name": "Maruko Chan",
              "id": "100001798922313"
            },
            "message": "LOL! iya.. hahaha",
            "can_remove": true,
            "created_time": "2012-01-24T09:14:24+0000"
          },
          {
            "id": "109379672518544_38576",
            "from": {
              "name": "Y.i. Kusumawati",
              "id": "1334087290"
            },
            "message": "sbenernya monyetnya yang mana",
            "can_remove": true,
            "created_time": "2012-01-25T00:01:56+0000"
          },
          {
            "id": "109379672518544_39568",
            "from": {
              "name": "Ali M. Fauzi",
              "id": "1248947710"
            },
            "message": "Nah.... Loh... pertanyaan bagus tuh....",
            "can_remove": true,
            "created_time": "2012-01-25T06:10:11+0000"
          },
          {
            "id": "109379672518544_39665",
            "from": {
              "name": "Ajungo Toriyama",
              "id": "1266357019"
            },
            "message": "Deval Agrifarman : salim dulu....sama kakak.....",
            "message_tags": [
              {
                "id": "896085636",
                "name": "Deval Agrifarman",
                "offset": 0,
                "length": 16
              }
            ],
            "can_remove": true,
            "created_time": "2012-01-25T07:13:39+0000"
          }
        ],
        "paging": {
          "next": "https://graph.facebook.com/109379672518544/comments?limit=25&method=GET&metadata=true&format=json&callback=___GraphExplorerAsyncCallback___&access_token=AAACEdEose0cBAKn8Nfv307rHgjdP9l9usbDj1KbQlzotoQDs6zuQEcxioPm73R3h1ZABBiNQyPG9iukYZAxjnxwmd6ZCNuYdkkKQ7KA4QZDZD&offset=25&__after_id=109379672518544_39665"
        }
      }
    },
    {
      "id": "335701516450154",
      "from": {
        "name": "Deval Agrifarman",
        "id": "896085636"
      },
      "message": "selamat tahun baru lagi yah :D sori nggak sempet bikin kartu ucapan :)",
      "link": "http://www.facebook.com/photo.php?fbid=10150484907061432&set=a.170757796431.134250.152798801431&type=1",
      "name": "Wall Photos",
      "icon": "http://static.ak.fbcdn.net/rsrc.php/v1/yD/r/aS8ecmYRys0.gif",
      "created_time": "2012-01-23T11:36:19+0000"
    }
  ],
  "paging": {
    "previous": "https://graph.facebook.com/896085636/links?limit=3&format=json&since=1327590201&__paging_token=141816652602643&__previous=1",
    "next": "https://graph.facebook.com/896085636/links?limit=3&format=json&until=1327318579&__paging_token=335701516450154"
  }
}

我需要的是例如:

  • 从1月份的'created_time'获取'link'的值
  • 获取'message'和'picture'的值以及'comments'中的所有'name'和'message'(如果有的话)

3 个答案:

答案 0 :(得分:1)

我主要使用此工具http://codedestine.com/json-editor.html它具有添加日期的功能,其拖放UI可以轻松构建json。它将在对象视图中显示json,然后您可以选择任何节点并获取其数据,甚至可以修改它。

答案 1 :(得分:0)

如果Java工具没问题,请查看JSONPath,文章http://goessner.net/articles/JsonPath/

  

可以在客户端上以JSON结构交互式查找和提取数据,而无需特殊脚本。

答案 2 :(得分:0)

我今天也找到了JSONselect http://jsonselect.org/#tryit

JSONSelect is an experimental selector language for JSON.

It makes it easy to access data in complex JSON documents.

It feels like CSS.

GitHub上的代码https://github.com/lloyd/JSONSelect
最近更新一年前