Skip to content

Instantly share code, notes, and snippets.

@noplans
Created August 28, 2009 00:57
Show Gist options
  • Save noplans/176697 to your computer and use it in GitHub Desktop.
Save noplans/176697 to your computer and use it in GitHub Desktop.
# twitter bots list
require 'nokogiri'
require 'open-uri'
BASE = 'http://usy.jp/twitter/index.php?%E4%BE%BF%E5%88%A9%E3%81%AABOT'
doc = Nokogiri::HTML(open(BASE))
list = doc.xpath('//a[@rel="nofollow"]')
.map{|x| x['href']}
.select{|link| %r|\Ahttps?://twitter\.com/| =~ link}
bots = list.map{|link| link.gsub(%r|\Ahttps?://twitter\.com/(\w+)?/?\z|, '\1')}.sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment