Live data from Hacker News

How I Hacked My University's Registration System with Python and Twilio

twilio.com

41–50 of 163 posts

Re: How I Hacked My University's Registration System with Python and Twilio

#41
post #25

I was in the US and want to immigrate to Canada because of US broken H1B immigration system ( for me it will take 9 years to get a greencard). Here is what I did - The immigration website of Saskatchewan province opens up randomly to apply for immigration. I missed it many times because there is no indication other than the "Apply" button being enabled and a small text in their homepage which says "Applications are n…

Nice story, and great that Twilio worked out for you - but this really is the sort of thing that email alerts (or IM alerts, or IRC alerts) should also work fine for.

I would argue that the fact that you find SMS/phone calls a more urgent alert is a fault with your phone/communication setup - and twilio is an interesting hack around that.

But there really should be an easy way to make just as much ruckus from a simple email, based on topic/sender filtering... (hm, maybe there's a nice side project for an app in there...).

Re: How I Hacked My University's Registration System with Python and Twilio

#42
This is pretty cool. I did something similar with adwords scripts a few years ago. I was doing facebook advertising a few years ago and the ads featured products that would occasionally sell out, but there wasn't a way to monitor them so if something sold out, the ad would go to an empty product page. I rigged up a system that would take a list of URLs, look for "sold out" on the content of the page and then send me a text if it found a sold out product. I used Adwords scripts because it was able to run jobs hourly and all I really knew at the time was JS. It was a fun little project.

Re: How I Hacked My University's Registration System with Python and Twilio

#43

I did this for one of my classes as well. But since it was just a one off, I just put this bash script in a cron job on a free-tier AWS ec2. It just did a quick and dirty parse of the html, which for my university wasn't behind a login wall. $seats="$(curl $URL | sed \"140qd\" | sed -nE \"s/ | //gp\")" if [ $seats -gt 0 ]; then echo "Go register for class $URL" | msmtp -a "default" $EMAIL fi

Yep. This is what I did. Also, I just used the email address for my phone's SMS. I'm not sure why you need Twilio for this, seems like over kill to me.

Re: How I Hacked My University's Registration System with Python and Twilio

#44
post #12

This is an interesting proof of concept. I'm impressed at how simple the SMS signup code is. For many universities though, it won't be this simple. Many hide the open seats behind a login, which means you need to be a student there to see them. Many also use student information systems that are a real pain to scrape like this. Once you get to the point where interacting with the student information system is done via…

Author here--you're totally right. When we did this for our actual registration site, we spent hours inspecting requests in a proxy[0] to get to ~194 lines of PHP. 0: We used https://www.charlesproxy.com/

Yeah, that's more what I'd expect to see with a standard student information system. I can only imagine the amount of work it took - the last time I encountered a site like that that I wanted to scrape I gave up (this was before I discovered PhantomJS).

It's really too bad that universities don't foster creativity like this.

Re: How I Hacked My University's Registration System with Python and Twilio

#45

Earlier quoted context omitted.

Greg from Twilio here. I love Southwest[1] and have wanted to do something like this forever. Would you be up for sharing the source? Can drop me a note at gb@twilio.com. [1]: http://baugues.com/southwest

I used this last year for ~ 10 flights. https://github.com/aortbals/southwest-checkin

This is great. And RUBY!! Thank you.

Re: How I Hacked My University's Registration System with Python and Twilio

#46
post #25

I was in the US and want to immigrate to Canada because of US broken H1B immigration system ( for me it will take 9 years to get a greencard). Here is what I did - The immigration website of Saskatchewan province opens up randomly to apply for immigration. I missed it many times because there is no indication other than the "Apply" button being enabled and a small text in their homepage which says "Applications are n…

> because of US broken immigration system

Immigration is working just fine: It is a rate-limiting mechanism to prevent massive immigration of every "me too" person from other random countries. You're just like everyone else, and everyone else wants to get in, too. Just like a lifeboat, the US can't let everyone in at once or we'd sink.

Buy a parka and enjoy Canada!

Re: How I Hacked My University's Registration System with Python and Twilio

#47
post #35

Need to be careful about this one. A student at my alma mater was suspended for doing the same thing: https://www.reddit.com/r/ucf/comments/xo5ye/ucf_student_pena... You have to love the education system...

In your example, he was charging for the service, which was against the terms of use of the web site he was scraping.

So in general, do be sure to not violate a site's terms, but I don't see what that point has to do with your final comment...

Re: How I Hacked My University's Registration System with Python and Twilio

#48

Wondering why you didn't also automate the process of actually signing up for the seat? Getting notified that a seat is open is helpful but automatically taking the open seat sounds a lot more helpful. Though at that point you'd have a lot more luck with selenium or some other web driver.

Would you rather fail to register for an open seat or fail to find an open seat? Maybe I'm biased because I made the same choice as an undergrad, I stopped short of registering for the class automatically.

Yeah, automating that next step is making the failure mode much worse.

Re: How I Hacked My University's Registration System with Python and Twilio

#49
post #41
post #25

I was in the US and want to immigrate to Canada because of US broken H1B immigration system ( for me it will take 9 years to get a greencard). Here is what I did - The immigration website of Saskatchewan province opens up randomly to apply for immigration. I missed it many times because there is no indication other than the "Apply" button being enabled and a small text in their homepage which says "Applications are n…

Nice story, and great that Twilio worked out for you - but this really is the sort of thing that email alerts (or IM alerts, or IRC alerts) should also work fine for. I would argue that the fact that you find SMS/phone calls a more urgent alert is a fault with your phone/communication setup - and twilio is an interesting hack around that. But there really should be an easy way to make just as much ruckus from a simpl…

Yeah, this isn't really a major Twilio win or a hack - it's a basic scraping technique.

I found a house for myself and a friend in a similar way, reverse engineer mobile app from MLS, scrape all listings once a day to get new stuff as it hits the market and you can now be far more selective than the crappy search on the MLS site allows.

Re: How I Hacked My University's Registration System with Python and Twilio

#50

I remember a classmate of mine doing the exact same 'hack' and distributed it to the whole school (Well, it was posted on school's major Facebook group with 10k-ish members) but it didn't have the SMS bit (It notified you via E-Mail, AFAIK).

I don't know about you, but for me receiving an email and receiving an SMS are identical notifications.
Post reply on HN