9lessons programming blog
Loading Search
Wednesday, October 21, 2009

Real Time Search Engine

Implement real-time search engine using twitter widget script with PHP for discovering what people are tweeting about on the web right now. I want to explain how you can use twitter widget script to implement search results feature that displays in real time tweets.
Real Time Search Engine

Download Script     Live Demo

real_search.php
Contains simple PHP and HTML code with Twitter widget script.
<form method="get" action="" name="form">
<input type="text" name="q" />
<input type="submit" value=" Search " />
</form>

<?php
if($_GET['q'])
{
$search_word=$_GET['q'];
?>
<div> 
//twitter widget code

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: '<?php echo $search_word; ?>',
interval: 8000,
subject: 'Realtime results for "<?php echo $search_word; ?>" ',
width: 600,
height: 520,
theme: {
shell: {
background: '#ffffff',
color: '#000000'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#1985b5'
}
},
features: {
scrollbar: false,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().start();
</script>
</div>
<?php
}
else
{
?>
<div> Reat Time Search Results </div>
<?php } ?>

Related Link
Sponsored Links

Share this post

Comments
{ 4 comments }
realturk said...

perfect thanx for samples..

Anonymous said...

nice but Demo not working

editor said...

aynen demo çalışmadı.. thankss

]N!cK[ said...

works fine

Post a Comment

Subscribe now!Recent Posts

Categories

Subscribe now!Popular Posts

People Says

@9lessons thank you for the great tutorials, we truly appreciate your contributions to the design community.

Smashing Magazine

Like Me

follow me
products

9lessons labs

9lessons clouds

Android application

Chrome Extension