Skip to content

Commit

Permalink
Updated path of IronMQ submodule so it will be uploaded. Updated work…
Browse files Browse the repository at this point in the history
…er to push the tweet to the queue.
  • Loading branch information
Paddy Foran committed Jan 10, 2012
1 parent 5c8c4e1 commit 84a1b53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .gitmodules
@@ -1,6 +1,9 @@
[submodule "lib/IronWorker"]
path = lib/IronWorker
url = git://github.com/iron-io/iron_worker_php.git
[submodule "lib/IronMQ"]
path = lib/IronMQ
[submodule "lib/worker/IronMQ"]
path = lib/worker/IronMQ
url = git://github.com/iron-io/iron_mq_php.git
[submodule "worker/lib/IronMQ"]
path = worker/lib/IronMQ
url = git://github.com/iron-io/iron_mq_php.git
2 changes: 1 addition & 1 deletion run.php
@@ -1,6 +1,6 @@
<?php

include("SimpleWorker.class.php");
include("lib/IronWorker/SimpleWorker.class.php");

$name = "tweetworker.php-".microtime(true);

Expand Down
16 changes: 14 additions & 2 deletions worker/execute.php
@@ -1,10 +1,22 @@
<?php

include("lib/IronMQ/IronMQ.class.php");

function getTweet($query) {
return file_get_contents("http://search.twitter.com/search.json?q=".$query."&rpp=1");
$results = file_get_contents("http://search.twitter.com/search.json?q=".$query."&rpp=1");
return $results["results"][0];
}

$config = parse_ini_file('config.ini', true);
print_r(getTweet($config['twitter']['query']));
echo "Searching for ".$config['twitter']['query']."...";

$tweet = getTweet($config['twitter']['query']);
print_r($tweet);

$mq = new IronMQ('config.ini', true);

$response = $mq->postMessage('', "TweetWorker", array("body" => $tweet["text"]));

print_r($response);

?>
Submodule IronMQ updated from 000000 to 5a0ebd

0 comments on commit 84a1b53

Please sign in to comment.