Skip to content

@mischa /people.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
Something went wrong with that request. Please try again.