Sunday, June 2, 2013

Craigslist Bot

I coded a Craigslist bot that scrapes all the new listings for a specific category you're looking in and auto-emails each of the vendors.  It was an interesting exercise in crawling that operates similarly to my C search engine here:

Why? I'm tired of browsing all the Craigslist postings and emailing each person. I thought it'd be a fun solution to auto-email the vendors, as I was going to email the same thing anyway.

In Python, BeautifulSoup parses the page for the Craigslist links. It saves them to a postgres database so that it won't duplicate-email the same URL.  It also "intelligently" remembers the name of the Craigslist posting so if somebody creates a duplicate with the same name to readvertise, it won't double-email them.

I've left it on overnight and it makes browsing Craigslist a lot easier.:

Saturday, April 20, 2013

Faster Google Searching on Chrome

I love Chrome's Omnibox.

But sometimes, I know what I'm searching for is the top result. So I'd like to use I'm Feeling Lucky in the Omnibox. That way, my searches can be faster. Here's a simple way to do this:

Go to Settings in Chrome. Under the Search heading label, click Manage Search Engines. Scroll all the way down to the 3 input boxes:

Add a new search engine  | Keyword  | URL with %s in place

Fill in:

Add a new search engine:  Lucky
Keyword:  (This is your shortcut that you type into the URL bar) then you press tab. I use "\"


Click Done.

Now you can go to your URL bar (Cmd-l), type in "\" then press <Tab> and you can search "I'm Feeling Lucky" in Omnibox!

Sunday, April 7, 2013

Presenting Course Scheduler App at Tuck Business School

Last Friday, I demoed my course scheduler app at Tuck Business School.

I built the demo in 2 days, Wednesday and Thursday. It helps students auto-schedule their courses by entering in their course dept and number and the Google Calendar API. It parses the Dartmouth Oracle Timetable here: and references the time slot and location. Example: try using COSC 065 for the Spring 2013 (This wouldn't work when the Fall Timetable is up).

I anticipate building a syllabus parser that goes through syllabuses and extracts more detailed information that would make the app more useful: textbook required (we could cross-reference this and even try to find a pdf for the user), course X-hrs. 

The feedback we received from the Tuck judges and other students was motivating! People thought it was cool and wanted to see it expand to reach all the other possibilities.

Monday, April 1, 2013

Course Auto-scheduler App Improvements!

Though I haven't yet set up any DNS (potentially hooking it up to Hacker's Club), the app is available.

Stuff learned:
  • The Google Calendar API v3 is pretty inconsistent. It took a lot of digging to find out how to craft the correct OAuth2 token dance and event array. 
  • Heroku is awesome for deploying Django!  Before, I used to use a git post-receive hook to connect to Amazon EC2, but Heroku makes it so much easier. 
  • How to config for separate environments. Before, I used a settings_local file that wasn't committed by git (sensitive db information). Now, os environ configs do the trick.
Stuff to-do:
  • Handle the edge cases (like period times: AR, special times on timetable (where it's not an existing period))
  • Add AJAX lookups for the correct class names (this will make user entry easier)

Sunday, March 31, 2013

Course Auto-scheduler Webapp

This app uses Google's oAuth2 Calendar API to automatically schedule your classes onto calendar.

It does this by scraping the Timetable for all available courses and cross-references them with the Dartmouth Meeting Time diagram here:

All this information is loaded into a Postgres database and referenced for Calendar API event insertions.

Thursday, March 28, 2013

API Improvements for FoCo Nutrition Scraper App

I built a FoCo (Dartmouth's dining hall) nutrition scraper API app that lets you query by year / month / day and returns a JSON listing of food offered in the dining hall that day, with associated nutrition facts for every single food item.

Integrated this with a mobile app that lets me create my own "food diary" application. I can enter in my food portions and calculate exactly how much macronutrients I'm taking in.

Eventually, we plan to merge this in with Timely as a zero-action feature. Imagine walking into FoCo and Timely pulls up the food offered that day with the associated nutrition facts seamlessly and automatically.

Monday, March 25, 2013

App for watching Courses automatically

For all the Dartmouth students who are struggling to find their Spring courses, I wrote an app that will monitor full courses and tell you when there is an availability via email.

Here is the code on github:

Basically, given the class you want to search, it scrapes Dartmouth's Course timetable online via post requests and then looks for the appropriate cells. Then it will sleep for half a minute, or however long you want, before checking again. If there is an availability, it will notify you via email.

Feel free to fork and improve on it.