Twitter bot in Empathy
By using an empty Empathy application as the glue (and using some of the wrapper code around Pheantalk for queues), we can easily create a twitter bot that favourites tweets for a given stream and thusly attacting attention to our own profile. The composer.json looks like this:
{
name: "newblog",
description: "A new blog",
require: {
mikejw/elib-base: "dev-develop",
pda/pheanstalk: "dev-master",
fennb/phirehose: "dev-master",
abraham/twitteroauth: "dev-master",
monolog/monolog: "1.13.1"
},
minimum-stability: "dev",
autoload: {
psr-0: {
HFSBot: "src/"
}
}
}
When a closure is not necessary
For a while, after being exposed to a lot of javascript during a project for a social gaming company it's been confused in my mind that closures in programming are useful for retaining data statically. This now makes sense because javascript isn't like other languages and it lacks the static keyword so there is no alternative.
Bind GET params to a Form in Zend Framework
The equivalent of this for POST data is widely documented but for GET parameters you use the $request->getQuery method as below: