Skip to content

Commit

Permalink
some fixes to tweeting logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cygri committed Jun 7, 2011
1 parent bdfda39 commit fcda12e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions jobs/scrape_DublinCity.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
$date1 = date('Y-m-d', time() - 7 * 24 * 60 * 60);
$applications = get_applications_in_period($date1, $date2);
foreach ($applications as $app) {
// @@@ TODO should probably update rather than just skip?
if ($planning->application_exists($app)) continue;
$app['tweet_id'] = null;
$planning->add_application($app);
}
Expand Down
2 changes: 1 addition & 1 deletion jobs/send_tweets.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if ($council == 'GalwayCity') continue; // That one's been running for a while already
echo "# COUNCIL: ".$council.PHP_EOL;
$twitter_account = $council . 'Pln';
$apps = $planning->get_applications("SELECT * from applications WHERE council_id = $council_id AND tweet_id IS NULL ORDER BY received_date ASC, app_ref DESC LIMIT 1");
$apps = $planning->get_applications("SELECT * from applications WHERE council_id = $council_id AND tweet_id IS NULL ORDER BY received_date ASC, app_ref ASC LIMIT 1");
foreach ($apps as $app) {
$result = $planning->tweet_application($app, $twitter, $bitly, false);
if (!$result) {
Expand Down
2 changes: 1 addition & 1 deletion setup/initial_tweeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if ($council == 'GalwayCity') continue; // That one's been running for a while already
echo "# COUNCIL: ".$council.PHP_EOL;
$twitter_account = $council . 'Pln';
$apps = $planning->get_applications("SELECT * from applications WHERE council_id = $council_id ORDER BY received_date DESC, app_ref DESC LIMIT 10");
$apps = $planning->get_applications("SELECT * from applications WHERE council_id = $council_id ORDER BY received_date DESC, app_ref ASC LIMIT 10");
foreach ($apps as $app) {
$result = $planning->tweet_application($app, $twitter, $bitly, true);
if (!$result) {
Expand Down

0 comments on commit fcda12e

Please sign in to comment.