Total members 11895 |It is currently Tue Dec 03, 2024 7:08 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Load tweets using JQuery
javascript code
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Microsoft jQuery template</title>
<link rel="stylesheet" href="website.css" />
<!-- You can download it -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="jquery.tmpl.js"></script>
</head>
<body>

<h1> Load tweets about something to your webpage. </h1>

<script id="tweets" type="text/x-jquery-tmpl">
<li>
<img src="${imgSource}" alt="${userName}" />
<h2> ${username} </h2>
<p> ${tweet} </p>

{{if geo}}
<span>
${geo}
</span>
{{/if}}
</li>
</script>

<ul id="twitter"></ul>

<script>
$.ajax({
type : 'GET',
dataType : 'jsonp',
url : 'https://twitter.com/search?q=%20Washington%20Post&src=typd',

success : function(tweets) {
var twitter = $.map(tweets.results, function(obj, index) {
return {
username : obj.from_user,
tweet : obj.text,
imgSource : obj.profile_image_url,
geo : obj.geo
};
});

$('#tweets').tmpl(twitter).appendTo('#twitter');
}
});

</script>
<div id="tweets" ></div>
</body>
</html>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Load tweets using JQuery
 Load RSS feeds and parse it with JQuery     -  
 Load Content to Tabs using AJAX and JQuery     -  
 Load file and update content using AJAX and JQuery     -  
 load class to applet- load frame class to applet     -  
 help me How do I load image from my pc to matlab     -  
 How to Load Files using JFileChooser!!     -  
 J2me Image load Exception     -  
 calculate the load time for a page     -  
 how to load the form elements depending on selection option     -  
 Add double quotes to text dynamically, on page load     -  



Topic Tags

JQuery GET/POST






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com