Acer Android tablets

According to sources from the notebook industry Acer is going to lauch 7 and 10 inch Android tablets in november or december , expedition is ARM hips will be used and operating system will be ANDROID . prototype of 7.2 inch tablet was shown during an event ,

acer android tablet

acer android tablet


Acer got the potential to seriously compete Apple’s IPAD . Apple already have 5 million +copies available in market but giant notebook manufacturer ACER got all to dominate the tablet market .

Stock ticker bar script for Joomla / Wordpress

few days back i coded a small script to show stock ups and downs ticker , script fetches data from yahoo finance and scrolls the ticker , you can use this script on on Joomla (tested on joomla 1.5) and all versions of wordpress .

How to use the script

<marquee id=”m1″ onmouseover=”this.stop();” onmouseout=”this.start();” truespeed=”" scrollamount=”2.4″ scrolldelay=”50″ direction=”left” loop=”repeat” width=”70%”>
<?php

function getStockSite($stockLink){

if ($fp = fopen($stockLink, ‘r’)) {
$content = ”;

while ($line = fread($fp, 1024)) {
$content .= $line;
}
}

return $content;
}

function processStockSite($wurl){

$wrss = getStockSite($wurl);
$name  = ‘-’;
$price = ”;
$diff  = ”;

if (strlen($wrss)>100){
$spos = 0;

// Get text
$spos = strpos($wrss,’</span>:’,$spos)+3;
$spos = strpos($wrss,’<big>’,$spos);
$epos = strpos($wrss,’</div><h1>’,$spos);
if ($epos>$spos){
$text = substr($wrss,$spos,$epos-$spos);
} else {
$text = ‘-’;
}

$spos = $epos + 10;
// Get company name
$epos = strpos($wrss,’<’,$spos);
if ($epos>$spos){
$name = substr($wrss,$spos,$epos-$spos);
}
// Get actual price
$spos = strpos($wrss,’yfs_l10′)+strlen(’yfs_l10′);
$spos = strpos($wrss,’>’,$spos)+1;
$epos = strpos($wrss,’<’,$spos);
if ($epos>$spos){
$price = substr($wrss,$spos,$epos-$spos);
} else {
$price = ‘-’;
}

// Get direction
$spos = strpos($wrss,’alt’,$epos)+strlen(’alt’)+2;
$epos = strpos($wrss,’”‘,$spos);
if ($epos>$spos){
$dir = strtolower(substr($wrss,$spos,$epos-$spos));
}

// Get difference
$spos = strpos($wrss,’>’,$epos+3)+1;
$epos = strpos($wrss,’<’,$spos);
if ($epos>$spos){
$diff = substr($wrss,$spos,$epos-$spos);
}

}

$result['name']  = $name;
$result['value'] = $price;
$result['diff']  = $diff;
$result['direction'] = $dir;
$result['text']  = $text;

return $result;

}

?>
<?
// Get stock data
//$data = processStockSite(’ttp://finance.yahoo.com’); // Google
$data = processStockSite(’http://finance.yahoo.com/q?s=GOOG’); // Google
?><html>
<style type=”text/css”>
<!–
.unnamed1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFFFFF;
background-color: #000000;
}
–>
</style>
<body class=”unnamed1″>
<?php echo $data['name']; ?>$
<?php
echo $data['text'];
//echo $data['value'].’ ‘;
//if ($data['direction'] == ‘up’) echo ‘<span class=”up”> +’.$data['diff'].’</span>’;
//else echo ‘<span class=”down”> -’.$data['diff'].’</span>’; ?>
</body>
</html>
<?php
$data = processStockSite(’http://finance.yahoo.com/q?s=MSFT’); // Microsoft
?><?php echo $data['name']; ?>$
<?php
echo $data['text'];
//echo $data['value'].’ ‘;
//if ($data['direction'] == ‘up’) echo ‘<span class=”up”> +’.$data['diff'].’</span>’;
//else echo ‘<span class=”down”> -’.$data['diff'].’</span>’; ?>
<?php
$data = processStockSite(’http://finance.yahoo.com/q?s=AAPL’); // Apple
echo $data['name'];
echo $data['text'];
$data = processStockSite(’http://finance.yahoo.com/q?s=GE’); // GE
echo $data['name'];
echo $data['text'];
$data = processStockSite(’http://finance.yahoo.com/q?s=BELFA’);//Bel Fuse Inc
echo $data['name'];
echo $data['text'];
$data = processStockSite(’http://finance.yahoo.com/q?s=BIOD’);//Bio Del
echo $data['name'];
echo $data['text'];
?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “DTD/xhtml1-transitional.dtd”>
<html>
<body>
<?php echo $data['name']; ?>$
<?php
echo $data['text'];
//echo $data['value'].’ ‘;
//if ($data['direction'] == ‘up’) echo ‘<span class=”up”> +’.$data['diff'].’</span>’;
//else echo ‘<span class=”down”> -’.$data['diff'].’</span>’; ?>
</body>
</html>
</marquee>

For Joomla
Download and install Joomla PHP component “Jumi” from here : http://extensions.joomla.org/extensions … ntent/1023
create new “Jumi “  module and paste this script and save the module . thats it !
For Wordpress
download this plugin :http://wordpress.org/extend/plugins/exec-php/
and paste the above script  , it will work !

you can replace or add stock values i.e http://finance.yahoo.com/q?s=AAPL ( for apple )  with any values by refering to yahoo finance .

Demo
http://universocanario.com/

« Previous Entries