Skip to content

Commit

Permalink
Tweak least likely follower insight copy and criteria [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed May 19, 2012
1 parent 6a6e2c0 commit 47940a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion webapp/_lib/model/class.FollowMySQLDAO.php
Expand Up @@ -329,7 +329,7 @@ public function getLeastLikelyFollowersByDay($user_id, $network, $days_ago=0, $l
$vars['end_days_ago'] = $end_days_ago;
}
$q .= "AND f.user_id = :user_id AND f.network=:network AND f.network=u.network AND active=1 ";
$q .= "AND follower_count > 10000 AND friend_count > 0 AND friend_count < (follower_count/2) ";
$q .= "AND follower_count > 1000 AND friend_count > 0 AND friend_count < (follower_count/2) ";
$q .= "ORDER BY likelihood_of_follow ASC, u.follower_count DESC LIMIT :limit;";
if ($this->profiler_enabled) Profiler::setDAOMethod(__METHOD__);
$ps = $this->execute($q, $vars);
Expand Down
2 changes: 1 addition & 1 deletion webapp/_lib/model/class.InsightMySQLDAO.php
Expand Up @@ -64,7 +64,7 @@ public function insertInsight($slug, $instance_id, $date, $text, $emphasis=Insig
public function getInsights($instance_id, $page_count=10, $page_number=1) {
$start_on_record = ($page_number - 1) * $page_count;
$q = "SELECT * FROM #prefix#insights WHERE instance_id=:instance_id ";
$q .= "ORDER BY date DESC LIMIT :start_on_record, :limit;";
$q .= "ORDER BY date DESC, id DESC LIMIT :start_on_record, :limit;";
$vars = array(
':instance_id'=>$instance_id,
":start_on_record"=>(int)$start_on_record,
Expand Down
12 changes: 9 additions & 3 deletions webapp/plugins/twitter/model/class.TwitterCrawler.php
Expand Up @@ -1907,9 +1907,15 @@ public function generateInsights() {
//$insight_date->sub(new DateInterval('P'.$days_ago.'D'));
$insight_date->modify('-'.$days_ago.' day');
$insight_date = $insight_date->format('Y-m-d');
$insight_dao->insertInsight('least_likely_followers', $this->instance->id, $insight_date,
"Good people: ".sizeof($least_likely_followers)." interesting users followed you.",
Insight::EMPHASIS_LOW, serialize($least_likely_followers));
if (sizeof($least_likely_followers) > 1) {
$insight_dao->insertInsight('least_likely_followers', $this->instance->id, $insight_date,
"Good people: ".sizeof($least_likely_followers)." interesting users followed you.",
Insight::EMPHASIS_LOW, serialize($least_likely_followers));
} else {
$insight_dao->insertInsight('least_likely_followers', $this->instance->id, $insight_date,
"An interesting user followed you.",
Insight::EMPHASIS_LOW, serialize($least_likely_followers));
}
}
$days_ago++;
}
Expand Down

0 comments on commit 47940a0

Please sign in to comment.