Check out the current stable version!
New widgets can be created using HTML, JavaScript, and PHP. Here is an example news widget:
###HTML (index.php)
<div id="news" class="roundedBox drag">
<div id='newsTitle'>News</div>
<div id='newsStories'></div>
</div>
###JavaScript (script.js)
function getNews(){
$.ajax({
type: "GET",
url: "getNews.php",
data: { }
}).done(function( response ) {
//console.log(response);
$('#newsStories').html( response);
});
}
$(document).ready(function() {
// get news headlines every 15 min
setInterval('getNews()', 900000);
getNews();
});
###PHP (getNews.php)
$url = "http://news.yahoo.com/rss/";
$response = file_get_contents($url);
$dom = new DOMDocument();
@$dom->loadHTML($response);
$x = new DOMXPath($dom);
$count=0;
foreach($x->query("//item") as $contextnode)
{
$title = $x->query("title", $contextnode)->item(0)->nodeValue;
$description = $x->query("description", $contextnode)->item(0)->nodeValue;
$explodedDescription = explode('"><img', $description);
$link = $explodedDescription[0];
$link = str_replace('<p><a href="', '', $link);
if($count>6)
exit();
echo "
<div class='newsRow'>
<a target='_blank' href='$link'>$title</a>
</div>
";
$count++;
}
- Gmail Unread Messages
- Twitter - new tweets
- Facebook new notifications
- Google Analytics API reports
- Make sure the problem you're addressing is reproducible.
- Indicate what browsers the issue can be reproduced in. Note: IE Compatibilty issues will not be addressed.
Copyright (c) 2013 Brian Roizen Licensed under the MIT license.