0

Twitter用のハッシュタグフィードを作成しようとしています。検索クエリの作成方法をすでに読んでおり、このjson構造を持っています...

{
  "completed_in": 0.026,
  "max_id": 201961894368653313,
  "max_id_str": "201961894368653313",
  "next_page": "?page=2&max_id=201961894368653313&q=wearetwo&lang=en&rpp=100&include_entities=1",
  "page": 1,
  "query": "wearetwo",
  "refresh_url": "?since_id=201961894368653313&q=wearetwo&lang=en&include_entities=1",
  "results": [
    {
{
      "created_at": "Sat, 12 May 2012 01:06:19 +0000",
      "entities": {
        "hashtags": [
          {
            "text": "wearetwo",
            "indices": [
              12,
              21
            ]
          }
        ],
        "urls": [

        ],
        "user_mentions": [
          {
            "screen_name": "crifor",
            "name": "Cristina Forlani",
            "id": 110646291,
            "id_str": "110646291",
            "indices": [
              3,
              10
            ]
          }
        ],
        "media": [
          {
            "id": 201101250740240387,
            "id_str": "201101250740240387",
            "indices": [
              34,
              54
            ],
            "media_url": "http:\/\/p.twimg.com\/Asp0haZCQAMC-Sq.jpg",
            "media_url_https": "https:\/\/p.twimg.com\/Asp0haZCQAMC-Sq.jpg",
            "url": "http:\/\/t.co\/1EXkTMYq",
            "display_url": "pic.twitter.com\/1EXkTMYq",
            "expanded_url": "http:\/\/twitter.com\/crifor\/status\/201101250740240384\/photo\/1",
            "type": "photo",
            "sizes": {
              "small": {
                "w": 340,
                "h": 455,
                "resize": "fit"
              },
              "large": {
                "w": 765,
                "h": 1024,
                "resize": "fit"
              },
              "thumb": {
                "w": 150,
                "h": 150,
                "resize": "crop"
              },
              "orig": {
                "w": 765,
                "h": 1024,
                "resize": "fit"
              },
              "medium": {
                "w": 600,
                "h": 803,
                "resize": "fit"
              }
            }
          }
        ]
      },
      "from_user": "stevoltan",
      "from_user_id": 165713968,
      "from_user_id_str": "165713968",
      "from_user_name": "Stefano Voltan",
      "geo": null,
      "id": 201116057396719616,
      "id_str": "201116057396719616",
      "iso_language_code": "en",
      "metadata": {
        "result_type": "recent"
      },
      "profile_image_url": "http:\/\/a0.twimg.com\/profile_images\/2163464409\/crepes_normal.jpg",
      "profile_image_url_https": "https:\/\/si0.twimg.com\/profile_images\/2163464409\/crepes_normal.jpg",
      "source": "<a href="http:\/\/twitter.com\/#!\/download\/iphone" rel="nofollow">Twitter for iPhone<\/a>",
      "text": "RT @crifor: #wearetwo belle facce http:\/\/t.co\/1EXkTMYq",
      "to_user": null,
      "to_user_id": 0,
      "to_user_id_str": "0",
      "to_user_name": null
    },

メディアのURLとテキストを抽出する必要があります...誰かが私を助けてくれますか..私はこれに本当に慣れていません...これの実用的な例を見せていただければ幸いです..少なくとも機能。 ..

4

1 に答える 1

0

このドキュメントでは、jQueryを使用して使用できる形式にデータを取得する方法を説明します。

http://api.jquery.com/jQuery.getJSON/

何かのようなもの:

$.getJSON('http://search.twitter.com/search.json?q=wearetwo&lang=en&result_type=recent&rpp=100&include_entities=true', function(data) {
  var media_url = data.results.media.media_url;
  var text = data.text;
});
于 2012-05-14T15:17:52.217 に答える