Skip to content

Instantly share code, notes, and snippets.

@mileszs
Last active December 19, 2015 11:09
Show Gist options
  • Select an option

  • Save mileszs/5945923 to your computer and use it in GitHub Desktop.

Select an option

Save mileszs/5945923 to your computer and use it in GitHub Desktop.
I finally wrote a script for pulling twitter usernames out of the Hacks && Happenings newsletters.
TWITTER_LINKS = /twitter\.com\/([\w\/]*)/
usernames = File.open('email.txt', 'r').readlines.map do |line|
matches = line.scan(TWITTER_LINKS).flatten
end.compact.flatten
['mileszs', '_swanson'].each { |n| usernames.delete(n) }
puts "... content from #{usernames.join(', ')}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment