Wishful Coding

Didn't you ever wish your
computer understood you?

Free premium Twitter marketing tool

A friend told me about someone who sells a Twitter product for marketeers for around €300. What this tool does is that it keeps track of hash tags you specify and mails tweets to you, so you can answer questions and get new followers.

I was surprised to say the least. I frequently write these kind of things, but I find them to trivial to sell, I told my friend. To prove my point, I wrote this Python script - which I will give away for free - that tracks keywords, makes a noise and opens tweets in a browser as it finds them.

import json
import webbrowser
import urllib2
import urllib

#http://dev.twitter.com/pages/streaming_api_methods#track
kwds = "#durftevragen photoshop"
# Twitter username
uname = ""
#Twitter password
pwd = ""

password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()

top_level_url = "http://stream.twitter.com"
password_mgr.add_password(None, top_level_url, uname, pwd)

handler = urllib2.HTTPBasicAuthHandler(password_mgr)

opener = urllib2.build_opener(handler)

data = opener.open('http://stream.twitter.com/1/statuses/filter.json?track=' + urllib.quote_plus(kwds))

for line in data:
    j = json.loads(line)
    url = 'http://twitter.com/' + j['user']['screen_name'] + "/status/" + j['id_str']
    print url
    print('\a')
    webbrowser.open(url)

Now that I have given you worth €300 of Python code for free, I'd like to ask you a favor. I recently started my own company that is specialized in Wordpress blogs, Twitter tools and other web services and I'd like to know about the Twitter tool you've always wanted and what you'd pay for it.

Some ideas of myself(and my friend):
  • Extend my Twitter email suit with this tracking.
  • Multiple keywords
  • Organized in nice IMAP folders.
  • Reply per email(No need to visit Twitter).
  • Assemble a FAQ/knowledge base on your Wordpress blog.
  • Tweet random facts from there.

The age of APIs ... and virtual ghost towns?

Nowadays almost any self-respecting site seems to have an API. What can you do with all this data?

  • Clients
  • Analytics
  • Aggregation
  • And... a clone?  Sure!

I was thinking it'd be fun to do a Reddit clone, and experiment with different voting systems. Point is, there are quite a few of them, so how am I going to get users? Answer: I don't need users!

I took this and this, and in a few hours(mostly spent updating the work of Lau), I had an autonomous Reddit clone running of the Twitter API, and I believe it to be possible to create a complete social network that runs without any user input.

The age of APIs ... and virtual ghost towns?

How much Clojure do you know?

How much Clojure do you know?

user=> (count (ns-publics 'clojure.core))
546

That are a lot of functions. Unless you wrote half of them I wager you don’t know them all. Don’t worry, neither do I. But it doesn’t hurt to learn some more. That is why I wrote a Clojure quiz.

Simply do the standard stuff(make sure you have git and lein or cake)

git clone git://github.com/pepijndevos/clojure-quiz.git
cake deps
cake repl
(use 'clojure-quiz.core)

Now you can play three types of quizzes.

  • (doc-quiz) Find the correct doc string for the given function.
  • (name-quiz-easy) Find the correct function for the given doc.
  • (name-quiz) Same as above, but without multiple choice.

(name-quiz) is by far the hardest, and I generally score around 70% while I can usually get 100% on the others.

You can tweak the quiz by using binding to set the namespace to use and the number of options to give:

(binding [target 'clojure.set number 5] (doc-quiz))

Have fun!

Published on