dtlrp119999 2011-05-13 17:09
浏览 43

Twitter搜索Feed,简洁明了

I am after a twitter feed of search terms and can find nothing on the internet other than single purpose widgets of no benefit to us.

We want a the results of a twitter search to display on a page.

For example if one of our pages is about golf I want to be able to pull tweets about golf (say 10) and style them myself based on our theme layouts. I do not want a conveluted widget with style attributes and theme files. Just the actual text from tweets about golf. No authors or dates if possible. Just the text and thats it.

Any ideas?

Marvellous

  • 写回答

4条回答 默认 最新

  • drrqwokuz71031449 2011-05-13 17:12
    关注

    The API provides everything you're looking for. Using a server-side RSS reader, it's as simple as pointing at the following URI: (will return results for #golf.)

    http://search.twitter.com/search.atom?q=%23golf

    Keeping everything client-side is just as easy using JSONP:

    http://search.twitter.com/search.json?q=%23golf&callback=?

    The jQuery code would look something like this:

    var url = "http://search.twitter.com/search.json?q=%23golf&callback=?";
    
    $.getJSON(url, function(data)
    {
      $("#golfTweets").empty();
        $.each(data.results, function()
        {
          var $newTweet = $("#tweetTemplate").clone();
          $newTweet.find(".body").text(this.text);
          $("#golfTweets").append($newTweet);
          $newTweet.show();
        }
    }
    

    Assuming this HTML:

    <div id="golfTweets">
      <div id="tweetTemplate" style="display:none;">
        <span class="body" />
      </div>
    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题