Creativity • February 11th, 2007 • 18 comments

Ruby auto emo generator

From Edward Ocampo Gooding, member of RubyMtl Group:

SOLICITATION FOR AUTO-EMO POETRY GENERATORS : Your Ruby script culls raw emo passion from Myspace, Livejournal and the
like to auto-generate “emo” poetry.

I used the “technorati API”:http://technorati.com/developers/api/ and the Rails framework, which was an error because it was overkill for something like this. “Camping”:http://code.whytheluckystiff.net/camping would have been more suitable. The code is here:

query = params[:emo][:theme1] + ‘+’ + params[:emo][:theme2]
url = “http://api.technorati.com/search?key=1fa5c5362121cf4eb7d70be06c8692cd&query=#{query}”
xml_data = Net::HTTP.get_response(URI.parse(url)).body

@results = Array.new()
if xml_data
xml = XmlSimple.xml_in(xml_data, { ‘ForceArray’ => false })
if xml['document'] and !xml['document'].empty?
xml['document']['item'].each do |post|
@results << post['title']
end
end
end
@results.sort{|x, y| y.length <=> x.length }

Took me a couple of hours to get the “Auto Emo Generator”:http://eumyang.com working. Ironically, the hardest part was deploying. I got the code running locally in 15 minutes but, as usual, it displayed the sandard _rails application 500 error_ on the web server.

18 responses to “Ruby auto emo generator”

  1. oo says:

    @results = Array.new()
    if xml_data
    xml = XmlSimple.xml_in(xml_data, { ‘ForceArray’ => false })
    if xml['document'] and !xml['document'].empty?
    xml['document']['item'].each do |post|
    @results < < post['title']
    end
    end
    end
    @results.sort{|x, y| y.length <=> x.length }

  2. Lalmotiam says:

    cute website,
    take a look at this freaky emo hair
    http://emo-boy.punkboy.info

  3. Husbandsdyhlm says:

    dzigkrofxqmpjbcy bacteriasqzu boys performers young stem professors asteroids coins lapwings managers wagers gypsies pearls thieves curs women monitors geologists husbands trucks beans falcons jugglers harpers cormorants builders tests referees sailors misers hammers stairs bacteria goths fairies information hoodlums bastards idiots weapons submarines girls corgis mountains islands monks guillemots pages tennis students riches colts bankers onlookers

  4. nutritionalhealthsupplementsvitaminsonline says:

    nutritional health supplements vitamins online nourish hair vitamins reviews ginkgo biloba JPlymENvbYKXh whole food vitamins coq10 review antioxidant vitamins nitric oxide supplements pycnogenol slimquick green tea reviews ginkgo vitamin b5 flavanols weight loss supplements for men vitamin e vitamin b12 shots vitamins online canada vitamin shop hair vitamins reviews orac units gnc multi vitamins reviews

  5. James E. says:

    The blog was precisely fantastic! Lots of nice information and afflatus, both of which we all need!

  6. vitamin manufacturing says:

    Are all your info right? I am not trying to be a jerk, but I don’t notice how this makes complete sense! Well Wishes!

  7. Best resveratrol says:

    Really nice article. I really have to agree mostly but there are still some stuff i don’t agree with you on this sorry.

  8. Gene Krepps says:

    While I wasdoing some browsing and noticed your blog looks a bit confusedin my IE6internet browser. I think I’m the only one still using it….

  9. Wilbert Kisor says:

    How do you do! I sumbled upon this post by accident, I was flipping through the worldwide web for grean tea when I came upon your webpage. I

  10. Pa Jaudon says:

    I have acquired the product but my checking account closed how can I ensure I continue to recieve the supply with opening my new account?

  11. Twyla Doroski says:

    Can I get identical results as the dentist would give me?

  12. Marilou Lutkus says:

    It seems that you’ve put a good amount of effort into your article and I want a lot more of these on the web these days. I truly got a kick out of your post. I do not have a bunch to to say in response, I only wanted to register to say special work.

  13. new myspace proxy says:

    Hey man I just wanted to say thanks for taking the time to write something worth my time to read. I am all over the internet and I see so much pointless content that is just written for the sake of putting something new on their page. It takes devotion to make good stuff, thanks for caring.

  14. Jim - WhiteFlood.info says:

    Hi, nice blog and informative entry… Thanks!

  15. prepclieste says:

    Hey your website is cute
    Check at that crazy emo song:
    http://tinyurl.com/8lxnsg

  16. prepclieste says:

    How are you? your website is cool
    Check out at this funny emo video:
    http://tinyurl.com/8b9p65

  17. Acai Optimum says:

    Will be credit card be charged more then once?

  18. the flex belt review says:

    Found a great wee tool for a great weight loss it’s called the flex belt.

Leave a Reply

Recent Projects

Categories

Recent Comments

Recent Posts

from heri.tumblr.com

Design

Friends and People I like reading

Marketing

Technology

World



Photos

snapshotGriot AfriqueTigre; Festival Nuits d'AfriqueSalam, Festival des nuits d'afriqueart anywherephoto.jpgphoto.jpgphoto.jpgmontreal startupdrinksNil Bleu

See more pictures

Heri is also at

Heri does not use Instant Messenging or other communications means that disrupts workflows.


© 2007 2008 Heri Rakotomalala
Photographs and Screenshots are under Creative Commons. Attribution-NonCommercial-ShareAlike 2.0
Screenshots, logos, videos, and trademarks showcased on this blog are the property of their respective owners.