Only The #1 Bookmarks http://sandbox.sourcelabs.com/livemarks/ The number one most bookmarked links on del.icio.us"; while ($row = mysql_fetch_assoc($result)) { echo "".preg_replace('/&/','&',htmlentities($row['title']))."{$row['link']}"; } echo ""; die(); } if (isset($_GET['feeds']) and $_GET['feeds']) { $ts=date("Y-m-d H:i:s", (time() - 60 * 25)); $sql = " select id, title, link from bookmarks where imported > '".$ts."' order by rand()"; $result = mysql_query($sql) or die ($sql.mysql_error()); while ($row = mysql_fetch_assoc($result)) { $marks[] = $row; } $bookmarks = ''; $delay = round((60 / ((count($marks) + 1) / 20)) * 800); if ($delay > 5000) $delay = 5000; if ($delay < 1700) $delay = 1700; if ($marks) { foreach ($marks as $mark) { $bookmarks .= "
"; $bookmarks .= "".htmlentities($mark['title'])." .oO
"; } } header('Content-type: text/javascript'); echo 'var bookmarks = "'.ereg_replace("[\r\n]"," \\n\\\n",ereg_replace('"','\\"',$bookmarks)).'"; '; echo 'var delay = "'.$delay.'";'; die(); } if ((isset($_GET['popular']) and $_GET['popular']) || ( isset($_GET['format']) and $_GET['format'] ) ) { $ts=date("Y-m-d H:i:s", (time() - 60 * 60 * 6)); $sql = "select title,link from bookmarks where imported > '".$ts."' "; $result = mysql_query($sql) or die($sql.mysql_error()); while ($row = mysql_fetch_assoc($result)) { $bookmarks[] = $row; } foreach ($bookmarks as $bm) { $frequency[$bm['link']] = $frequency[$bm['link']] + 1; $bookmarkTitle[$bm['link']] = $bm['title']; } foreach (array_keys($frequency) as $link) { $data[] = array('link' => $link, 'frequency' => $frequency[$link]); $links[] = $link; $linkFreq[] = $frequency[$link]; } array_multisort($linkFreq, SORT_DESC, $links, SORT_ASC, $data); $sql = " SELECT link FROM topMarks WHERE link = '".mysql_real_escape_string($data[0]['link'])."'"; $result = mysql_query($sql) or die($sql.mysql_error()); if (mysql_num_rows($result) < 1) { mysql_query("INSERT INTO topMarks SET link = '".mysql_real_escape_string($data[0]['link'])."', title = '".mysql_real_escape_string($bookmarkTitle[$data[0]['link']])."'") or die(mysql_error()); } if ($_GET['format'] == 'rss') { header("Content-Type: text/xml"); echo " Top Hourly Bookmarks http://sandbox.sourcelabs.com/livemarks Constantly updated list of the top bookmarked URLs in the past hour"; for ($i = 0; $i < 17; $i++) { echo " ".preg_replace("/&/","&",htmlentities($bookmarkTitle[$data[$i]['link']])).""; echo " ".htmlentities($data[$i]['link']).""; echo " "; } echo " "; } else { for ($i = 0; $i < 37; $i++) { $topLinkies[] = "link = '".$data[$i]['link']."'"; } $ts=date("Y-m-d H:i:s", (time() - 60 * 60 * 18)); $sql = " SELECT DISTINCT link FROM bookmarks where imported < '".$ts."' AND (".implode($topLinkies," OR ").")"; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $oldLink[$row['link']] = 1; } for ($i = 0; $i <37; $i++) { echo "
".$data[$i]['frequency']. "".htmlentities($bookmarkTitle[$data[$i]['link']])."".(($oldLink[$data[$i]['link']] == 1) ? "" : " NEW")." .oO
"; } echo "
SourceLabs Alex Bosworth - LiveMarks - LiveMarks wiki on SWiK - src(s)
"; } die(); } $ts=date("Y-m-d H:i:s", (time() - 60 * 10)); $sql = " select id, title, link from bookmarks where imported > '".$ts."' order by rand() limit 15"; $result = mysql_query($sql) or die ($sql.mysql_error()); while ($row = mysql_fetch_assoc($result)) { $marks[] = $row; } $bmarks = ''; if ($marks) { foreach ($marks as $mark) { $bmarks .= "
"; $bmarks .= "".htmlentities($mark['title'])." .oO
"; } } echo " LiveMarks
(alex bosworth) @ (sourcelabs)
LiveMarks Live Bookmarking - ? people currently watching
".$bmarks; echo "
Welcome to del.icio.us live (LiveMarks Wiki .oO)
"; ?>