Sunday, June 24, 2012

Real Time Search Engine

Real Time Search Engine
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 } ?>

No comments:

Post a Comment