Skip to content

Instantly share code, notes, and snippets.

@mischa
Created June 7, 2009 07:51
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 mischa/125236 to your computer and use it in GitHub Desktop.
Save mischa/125236 to your computer and use it in GitHub Desktop.
require 'twitter'
types = ['istj', 'estj', 'isfj', 'esfj', 'istp', 'estp', 'esfp', 'isfp', 'entj', 'entp', 'intp', 'enfj', 'infj', 'enfp', 'infp']
File.delete "people.html"
File.open("people.html", "w") do |f|
f << %Q{
<html>
<head>
<title>People</title>
</head>
<body>
<h1>Personality types by twitter profile picture</h1>
}
seen = []
types.each do |type|
f << %Q{<h2><a href="http://www.personalitypage.com/#{type.upcase}.html">#{type}</a></h2>}
tweets = Twitter::Search.new(type).per_page(50).fetch.results
tweets.each do |tweet|
next if tweet.profile_image_url == "http://static.twitter.com/images/default_profile_normal.png"
next if seen.include?(tweet.from_user_id)
seen << tweet.from_user_id
f << %Q{<a href="http://twitter.com/#{tweet.from_user}"> <img width=48px src="#{tweet.profile_image_url}" /></a>}
end
end
f << "</body></html>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment