Javascript json twitter查询,解析为html提要

Javascript json twitter查询,解析为html提要,javascript,json,api,twitter,Javascript,Json,Api,Twitter,我正在尝试为twitter构建hastag提要, 我已经阅读了如何创建搜索查询,我有这个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&inclu

我正在尝试为twitter构建hastag提要, 我已经阅读了如何创建搜索查询,我有这个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和文本。。。有人能帮帮我吗。。我对这个真的很陌生。。。如果您能给我一个这样的工作示例,我将不胜感激。至少函数…

本文档将向您展示如何将数据转换为使用jQuery可以使用的格式:

比如:

$.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;
});

您是否真的通过使用类似$.getJSON的东西将此JSON返回到对象中?我在这里使用了此服务。。。这是我添加的查询。。。非常感谢。我已经读了大约3个小时了。。。对不起,我可能看起来很愚蠢,但这对我来说是全新的。。我如何应用这个?。。。如何将其附加到html?。。。你能告诉我如何构建这个函数吗?我不会为你写代码的。您需要学习基本的javascript或jQuery。或者至少发布你尝试过的内容(并接受我的回答)