Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter 推特标签_Twitter_Social Networking - Fatal编程技术网

Twitter 推特标签

Twitter 推特标签,twitter,social-networking,Twitter,Social Networking,我想将twitter hastag小部件添加到我的应用程序“我该怎么做”。该功能应该要求用户添加特定事物的哈希标记,并将其添加到他的个人资料页面,我该如何做 请向我推荐逻辑和实现我终于找到了这个问题的解决方案,我能够从twitter上检索提要并将其发布到我的web应用程序上,我搜索特定的哈希标记,并将显示该特定哈希标记的提要 这是密码 <script type="text/javascript"> $(document).ready(function() // don

我想将twitter hastag小部件添加到我的应用程序“我该怎么做”。该功能应该要求用户添加特定事物的哈希标记,并将其添加到他的个人资料页面,我该如何做


请向我推荐逻辑和实现

我终于找到了这个问题的解决方案,我能够从twitter上检索提要并将其发布到我的web应用程序上,我搜索特定的哈希标记,并将显示该特定哈希标记的提要

这是密码

 <script type="text/javascript">    
   $(document).ready(function() // don't do anything until the document is loaded.
   {    
   $("#submit").click(function(event){ // wire up this as an onclick event to the submit button.
var searchTerm = $("#search").val()  ; // get the user-entered search term
var baseUrl = "http://search.twitter.com/search.json?q=%23"; 
$.getJSON(baseUrl + searchTerm + "&rpp=1500&callback=?", function(data) // call getJSON providing the complete url with search term and a JSONP callback
{
$("#tweets").empty(); // clear out any previous results.
if(data.results.length < 1) // friendly "no results"
  $('#tweets').html("No results JOINEVENTUS"); 
$.each(data.results, function() // iterate over the results;
{
$('<div align="justify"></div>')
.hide()
.append('<img src="' + this.profile_image_url + '" width="80px" /> ')
.append('<span><a href="http://www.twitter.com/'
+ this.from_user + '">' + this.from_user 
+ '</a> ' + makeLink(this.text) + '</span>')
.appendTo('#tweets') // append the constructed results HTML to the tweets div
.fadeIn(2000); // fade in the results over 2 seconds.
});
});
});
});

function makeLink(text) // this REGEX converts http(s) links that are embedded in the tweet text into real hyperlinks.
{   
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;   
return text.replace(exp,"<a href='$1'>$1</a>"); 
} 
</script> 
</HEAD>
<BODY style="margin-left:20%;margin-right:20%"> 
<div align="center">
<h2>Twitter tag search</h2>
<div>Enter Search Term</div>
<input type="text" id=search />
<input type="button" id=submit value="Search" /> 
<DIV id="tweets" />  
</div>

</BODY>