AddThis Social Bookmark Button

digg

Breaking News

Vote for my STORY Thanks!

Embedded OSes [Linux & Co.]

Today, the boundaries between the general purpose PCs, the servers and the embedded systems are more blurred. These computers are sharing same platforms, same peripherals. For example, an x86/Mac PC can be used as a server, an x86/PowerPC CPU can be used in an embedded system like portable navigation device (PND). On the other way, the popular....

EDIGGcode

<?php

$edigg_url = "/EDIGG";
$edigg_plus = "/EDIGGPLUS";
$user_role = "TEST"; // wait Digg authorization

function getStories($topic){
$url = "http://services.digg.com/stories/topic/$topic/upcoming?appkey=YOUR_APPKEY_DATA"; // READ_DIGG API DOC

if (!($digg = fopen($url, "r"))) {
return false;
}

while (!feof($digg)) {
$data .= fgets($digg);
}

fclose($digg);

if (!($xml = new SimpleXMLElement($data))) {
return false;
}

return $xml;
}

function user_has_role($role, $user = NULL) {
if ($user == NULL) {
global $user;
}

if (is_array($user->roles) && in_array($role, array_values($user->roles))) {
return TRUE;
}

return FALSE;
}

ini_set('user_agent', 'Trallallà/1.0');

print "window.setTimeout(\"window.location.href = '$edigg_url'\",50000);\n";

$tech = getStories("tech_news");
$hw = getStories("hardware");
if ($tech != false && $hw != false) {
for ($i=0; $i<6; $i++) {
if ($i % 2 == 0)
$story = $tech->story[$i/2];
else
$story = $hw->story[($i-1)/2];
$date = $story['submit_date'];
settype($date, int);