From Zero To SEO Achieving High Rankings Through Coding

24Apr/090

Scraping Twitscoop

What's hot on Twitter right now? You can scrap twitter trending topics to answer the question. But there is something hotter – Twitscoop. So what we are waiting for? Let's scrap Twitscoop tag cloud.

Simple Twitscoop tag cloud scraper

General idea:

  • Get a homepage
  • Extract tags
  • Remove duplicate tags

Example

<?php
$file = file_get_contents("http://www.twitscoop.com");
preg_match_all("(<em class='blue'>(.*)</em>)siU",
    $file, $matches);
 
$matches = array_values(array_unique($matches[1]));
 
for ($i = 0; $i < count($matches); $i++) {
    $matches[$i] = strtolower($matches[$i]);
}
 
$matches = array_values(array_unique($matches));
 
// Job's done! $matches stores everything you need.
?>

Widget

BTW, there is a nice looking Twitscoop widget which displays hot trends and buzzing tag cloud. You can grab the code here.

What’s hot on Twitter right now? Now you know.

Posted by seozero

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.