Skip to content

Commit

Permalink
Facebook crawler bugfix: Corrected user avatar path
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed Feb 18, 2011
1 parent f8fe90b commit 1a640c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webapp/plugins/facebook/model/class.FacebookCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ private function parseStream($stream, $network) {
array_push($thinkup_posts, $ttp);
//Get users
$ttu = array("user_name"=>$c->from->name, "full_name"=>$c->from->name,
"user_id"=>$c->from->id, "avatar"=>'https://graph.facebook.com/'.$c->id.'/picture',
"location"=>'', "description"=>'', "url"=>'', "is_protected"=>'true',
"user_id"=>$c->from->id, "avatar"=>'https://graph.facebook.com/'.$c->from->id.
'/picture', "location"=>'', "description"=>'', "url"=>'', "is_protected"=>'true',
"follower_count"=>0, "post_count"=>0, "joined"=>'', "found_in"=>"Comments",
"network"=>'facebook'); //Users are always set to network=facebook
array_push($thinkup_users, $ttu);
Expand Down Expand Up @@ -297,8 +297,8 @@ private function parseStream($stream, $network) {
array_push($thinkup_posts, $ttp);
//Get users
$ttu = array("user_name"=>$c->from->name, "full_name"=>$c->from->name,
"user_id"=>$c->from->id, "avatar"=>'https://graph.facebook.com/'.$c->id.'/picture',
"location"=>'', "description"=>'', "url"=>'', "is_protected"=>'true',
"user_id"=>$c->from->id, "avatar"=>'https://graph.facebook.com/'.$c->from->id.
'/picture', "location"=>'', "description"=>'', "url"=>'', "is_protected"=>'true',
"follower_count"=>0, "post_count"=>0, "joined"=>'', "found_in"=>"Comments",
"network"=>'facebook'); //Users are always set to network=facebook
array_push($thinkup_users, $ttu);
Expand Down
13 changes: 13 additions & 0 deletions webapp/plugins/facebook/tests/TestOfFacebookCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ public function testFetchUserPostsAndReplies() {
$this->assertPattern('/not the target demographic/', $post->post_text);
$this->assertEqual($post->reply_count_cache, 0);
$this->assertEqual($post->in_reply_to_post_id, '153956564638648');

$user_dao = new UserMySQLDAO();
$user = $user_dao->getUserByName('Gina Trapani', 'facebook');
$this->assertTrue(isset($user));
$this->assertEqual($user->username, 'Gina Trapani');
$this->assertEqual($user->full_name, 'Gina Trapani');
$this->assertEqual($user->user_id, 606837591);
$this->assertEqual($user->avatar, 'https://graph.facebook.com/606837591/picture');

$user = $user_dao->getUserByName('Mitch Wagner', 'facebook');
$this->assertTrue(isset($user));
$this->assertEqual($user->user_id, 697015835);
$this->assertEqual($user->avatar, 'https://graph.facebook.com/697015835/picture');
}

public function testFetchPageStream() {
Expand Down

0 comments on commit 1a640c5

Please sign in to comment.