Created
June 7, 2009 07:51
-
-
Save mischa/125236 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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