':.:':.:::.      .,-:::::/ :::::::..    :::.  .-:.     ::-.
 `;' `;;;`;;   ,;;-'````'  ;;;;``;;;;   ;;`;;  ';;.   ;;;;'
      ,[[ '[[, [[[   [[[[[[/[[[,/[[['  ,[[ '[[,  '[[,[[['  
     c$$$cc$$$c"$$c.    "$$ $$$$$$c   c$$$cc$$$c   c$$"    
      888   888,`Y8bo,,,o88o888b "88bo,888   888,,8P"`     
      YMM   ""`   `'YMUP"YMMMMMM   "W" YMM   ""`mM"        
#

Python!

Sat Oct 18 16:34:40 UTC 2014

I wrote the original crawling code for the @tilde_fortune bot in perl. It's still there, the files are src/extract_users.pl and src/local_crawl.pl. But when I decided to store text in a sqlite3 database I ran into a roadblock when I discovered that the perl installation on tilde.club didn't include DBI.

So I checked whether it was possible with python and lo and behold the necessary packages were present. Rewrite the code in python? challenge accepted. It was easier than I expected and I really like python. Dare I say it but it is now my language-of-choice for small things like this. I'm so sorry, perl. I never thought this day would come.

I have googled how to do specific things in python but not really immersed myself in python culture/community so I have a feeling that my python code is not very pythonic (I think that's the word). Like, I'm not creating any classes. Just functions. eg:

add_users_to_db(get_users(user_url))

Verdict: python good.




Click for the [ Random page ]
Want to join the ring? Click here for info.