-
-
Save boazsender/1813683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Twitter Search Plugin</title> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script src="https://github.com/boazsender/jQuery-Twitter-Plugin/blob/master/dist/jquery.twitter.js"></script> | |
<style type="text/css"> | |
.twitter-posts li { margin-bottom: 10px; font-size: 12px; clear: both; list-style-type:none; } | |
.twitter-posts li img { float:left; width: 48px; margin:0px 10px 10px 0px;border:1px solid #c2c2c2; -moz-box-shadow: 0px 0px 4px #c2c2c2; -webkit-box-shadow: 0px 0px 4px #c2c2c2; box-shadow: 0px 0px 4px #c2c2c2; } | |
.twitter-posts li a { text-decoration:none; color: #009; } | |
</style> | |
<script type="text/javascript"> | |
$(function(){ | |
// Call twitter search for tweets including the string 'bocoup loft' | |
$('#bocoup').twitter('bocoup loft'); | |
// Call twitter search for tweets including the string 'omgomg' | |
// and limit to 5 results | |
// and don't show tweets with the word 'lol' | |
// and don't show tweets with an '_' or an 's' in them | |
// and don't show @replies | |
// and don't show retweets | |
// and only show results with links | |
$('#omg').twitter({ | |
limit : 5, // Number of tweets to get <-- not in twitter api, maps to and supersedes rpp (results per page) | |
exclusions : '_ s', // Space delimited list of strings to exclude (eg: '_ s gr @b') <-- not in twitter api, done in plugin | |
replies : false, // Include mentions <-- not in twitter api, done in plugin | |
retweets : false, // Include mentions <-- not in twitter api, done in plugin | |
ors : 'omg', // Any of these words | |
nots : 'lol' // None of these words | |
}); | |
// Call twitter search for tweets from boazsender | |
// and limit 5 results | |
// and set special text to display if none are found | |
// and don't show @replies | |
// and don't show retweets | |
// and list out all the possible options properties for learning! | |
$('#boazsender').twitter({ | |
limit : 5, // Number of tweets to get <-- not in twitter api, maps to and supersedes rpp (results per page) | |
exclusions : '@ #', // Space delimited list of strings to exclude (eg: '_ s gr @b') <-- not in twitter api, done in plugin | |
notFoundText : 'No results found on twitter', // Text to display if no results are found <-- not in twitter api, done in plugin | |
replies : true, // Include replies? <-- not in twitter api, done in plugin | |
retweets : true, // Include replies? <-- not in twitter api, done in plugin | |
ands : '', // All of these words | |
phrase : '', // This exact phrase | |
ors : '', // Any of these words | |
nots : '', // None of these words | |
tag : '', // This hashtag | |
lang : '', // Written in language | |
from : 'boazsender', // From this person | |
to : '', // To this person | |
ref : '', // Referencing this person | |
near : '', // Near this place | |
within : '', // Within this distance | |
units : '', // Distance unit (miles or kilometers) | |
since : '', // Since this date | |
until : '', // Until this date | |
tude : '', // Attitude: '?' or ':)' or ':)' | |
filter : '', // Containing: 'links' | |
include : '', // Include retweet?: 'retweets' | |
rpp : 5, // Results per page | |
q : '', // Plain query | |
avatar : true //Add an avatar image of the user | |
}); | |
// Call twitter search for tweets from rwaldron | |
// and limit 5 results | |
// and don't show @replies | |
// and don't show retweets | |
$('#rwaldron').twitter({ | |
from : 'rwaldron', // From this person | |
limit : 5, // Number of tweets to get <-- not in twitter api, maps to and supersedes rpp (results per page) | |
replies : false, // Include replies? <-- not in twitter api, done in plugin | |
retweets : false // Include replies? <-- not in twitter api, done in plugin | |
}); | |
// Call twitter search for tweets from asdasdhdajkhjfdasasd | |
// and limit 5 results | |
$('#asdasdhdajkhjfdasasd').twitter({ | |
from : 'asdasdhdajkhjfdasasd', // From this person | |
limit : 0, // Number of tweets to get <-- not in twitter api, maps to and supersedes rpp (results per page) | |
notFoundText : 'this is special text to sho if no results are found.', // Text to display if no results are found <-- not in twitter api, done in plugin | |
}); | |
}); | |
</script> | |
<link href="twitterSearch.jQuery.css" media="screen" rel="stylesheet" type="text/css"> | |
</head> | |
<body> | |
<h1>Twitter:</h1> | |
<h2>'bocoup loft':</h2> | |
<div id="bocoup" class="twitter-posts"> | |
<h3>Loading Tweets From The Cloud With AJAX HTML5...</h3> | |
</div> | |
<hr class="space" /> | |
<h2>'omg':</h2> | |
<div id="omg" class="twitter-posts"> | |
<h3>Loading Tweets From The Cloud With AJAX HTML5...</h3> | |
</div> | |
<hr class="space" /> | |
<h2>@BoazSender</h2> | |
<div id="boazsender" class="twitter-posts"> | |
<h3>Loading Tweets From The Cloud With AJAX HTML5...</h3> | |
</div> | |
<hr class="space" /> | |
<h2>@rwaldron</h2> | |
<div id="rwaldron" class="twitter-posts"> | |
<h3>Loading Tweets From The Cloud With AJAX HTML5...</h3> | |
</div> | |
<hr class="space" /> | |
<h2>@asdasdhdajkhjfdasasd</h2> | |
<div id="asdasdhdajkhjfdasasd" class="twitter-posts"> | |
<h3>Loading Tweets From The Cloud With AJAX HTML5...</h3> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment