Skip to content

Instantly share code, notes, and snippets.

@yasuhito
Created February 12, 2013 06:52
Show Gist options
  • Save yasuhito/4760689 to your computer and use it in GitHub Desktop.
Save yasuhito/4760689 to your computer and use it in GitHub Desktop.
Vote-for-Trema-on-every-packet_in-receive controller
require "rubygems"
require "mechanize"
class VoteForTrema < Controller
def start
info "OK, I'm registered to vote"
end
def packet_in dpid, message
Mechanize.new { | agent |
agent.user_agent_alias = "iPhone"
agent.get "http://www.micropoll.com/a/mpview/1130680-3744756"
agent.click "Trema"
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment