jijodasgupta Posted February 22, 2009 Share Posted February 22, 2009 hey guys,ive a code to parse json feed off twitter dependin on the input(say a word) the user provides.... <script type="text/javascript"> $(document).ready(function(){ $('form#search').bind("submit", function(e){ e.preventDefault(); $('#content').html(''); var query = urlencode($('input[name="searchTerm"]').val()); //what to search for var rpp = 20; //number of tweets to retrieve out $.getJSON('http://search.twitter.com/search.json?callback=?&q='+query+'&rpp='+rpp, function(data){ $.each(data.results, function(i, item){ console.log(item); var newDiv = '<p><a href="http://www.twitter.com/'+item.from_user+'">'+item.from_user+'</a> - '+item.text+'</p>'; $('#content').append(newDiv); }); }); }) function urlencode(str) { return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); } }) </script> ...now i wanna do smthin different...i wanna highlight tht particular word i the json text before echo-ing it....how do i do tht using javascript n css??? Link to comment https://forums.phpfreaks.com/topic/146335-parsing-json-feed/ Share on other sites More sharing options...
darkfreaks Posted February 22, 2009 Share Posted February 22, 2009 http://www.tedpavlic.com/post_simple_inpage_highlighting_example.php something like that ??? Link to comment https://forums.phpfreaks.com/topic/146335-parsing-json-feed/#findComment-768275 Share on other sites More sharing options...
jijodasgupta Posted February 22, 2009 Author Share Posted February 22, 2009 :Dthnx....thts exactly wat i wanted!!!!! Link to comment https://forums.phpfreaks.com/topic/146335-parsing-json-feed/#findComment-768278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.