views:

55

answers:

2

Hi, I just got some crazy ideas for analyzing the Twitter social graph (i.e., representing follow-relations as the edges of a graph). Interestingly, the Twitter API provides methods for creating the graph. It is possible to read out a static snapshot of the social graph, whereas Twitter is a very dynamic network. It would be great if one could dynamically update the graph. So my question is: Is there any way to get notified by Twitter when anyone starts or stops to follow anyone?

+1  A: 

I believe that the documentation you linked to would definitely mention that.

I'm quite certain that you need to do your own follower-list checking, and compare results on a regular basis.

anonymous coward
A: 

I do this if someone follows me or not and how many followers they have and i generate this chart

public function existsFriendship($username,$friend)
  {
    try
    {
      if ($this->twitter->existsFriendship($username, $friend))
        return true;
    }
    catch(Exception $e)
    {
        $this->debug($e->getMessage());
    }

  }

for the chart generation i use pchart.

in smarty template the code looks like this;

include("pChart/pData.class");   
include("pChart/pChart.class"); ![alt text][1]
 // Initialise the graph
 $Test = new pChart(700,230);
 $Test->setFontProperties("Fonts/tahoma.ttf",13);
 $Test->setGraphArea(40,30,680,200);
 $Test->drawGraphArea(252,252,252,TRUE);
 $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2);
 $Test->drawGrid(4,TRUE,230,230,230,70);

 // Draw the line graph
 $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
 $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255);

 // Finish the graph
 $Test->setFontProperties("Fonts/tahoma.ttf",12);
 $Test->drawLegend(45,35,$DataSet->GetDataDescription(),255,255,255);
 $Test->setFontProperties("Fonts/tahoma.ttf",12);
 $Test->drawTitle(60,22,"Twitter Graph",50,50,50,585);

 $example = $Test->Render("templates/example1.png");
 $smarty->assign("example",$example);
 $smarty->display('index.tpl');

finaly the result alt text

streetparade

related questions