Skip to content

Instantly share code, notes, and snippets.

@andypearson
Created March 21, 2019 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andypearson/55045abef21577b755e6cff9a5fc0af0 to your computer and use it in GitHub Desktop.
Save andypearson/55045abef21577b755e6cff9a5fc0af0 to your computer and use it in GitHub Desktop.
BitBar plugin for showing latest signature count of Revoke Article 50 and remain in the EU petition
#!/usr/bin/env ruby
require 'json'
require 'open-uri'
json = JSON.parse(open("https://petition.parliament.uk/petitions/241584/count.json").read, symbolize_names: true)
puts json[:signature_count].to_s.chars.to_a.reverse.each_slice(3).map(&:join).join(",").reverse
puts "---"
puts "View petition | href=https://petition.parliament.uk/petitions/241584"
@andypearson
Copy link
Author

You'll need https://getbitbar.com for this plugin to make any sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment