News for hackers. Stuff that matters.
Re:Ask HN: What non-work task have you automated? by t1o5 on Wednesday October 11, 2017 @03:28PM (#15452647)
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 now 'open' ". They will close the application intake when they have reached X number of applicants. So timing is very important.

So I hacked up a script which diffs their home page every 10 minutes for "open" regex. When there is an "open" keyword in the diff, the python script calls twilio API to make a phone call to me along with an SMS.

So this script was running in AWS for many weeks and one day I got the call. Logged in to Saskatchewan's immigration homepage and applied. Now I am in Canada as a permanent resident. Thanks to Twilio. edit: add H1B to make clear which type of immigration is broken IMO.

(This comment is from my previous HN account, for which I lost my pwd.)

Re:Ask HN: What non-work task have you automated? by laktek on Wednesday October 11, 2017 @06:32PM (#15454119)
If you want to build stuff like this in future, check Page.REST a simple API I built. You can pass a query string `contains=TEXT` to check the existence of a word or a phrase.

Here's a Postman collection of all possible options with the API https://app.getpostman.com/run-collection/620bbe44b6ecc6c2e3...

Re:Ask HN: What non-work task have you automated? by bakli on Wednesday October 11, 2017 @11:29PM (#15455455)
You can maybe add a glitch repo to make it easier to get started.
Re:Ask HN: What non-work task have you automated? by laktek on Thursday October 12, 2017 @12:29AM (#15455676)
Thanks! I looked at Glitch but didn't quite get how I can make a shareable sample.
Re:Ask HN: What non-work task have you automated? by richev on Wednesday October 11, 2017 @07:56PM (#15454586)
https://visualping.io/ can do this, although it sends email alerts rather than SMS messages.

I used it to notify me of new Hololens events, listed on this page https://www.microsoftevents.com/profile/web/index.cfm?PKwebI...

Re:Ask HN: What non-work task have you automated? by jonah on Thursday October 12, 2017 @12:29AM (#15455678)
Other possible services include https://uptimerobot.com/ and https://www.pingdom.com/

Just set it to check for the presence of a word on the page, etc.

Re:Ask HN: What non-work task have you automated? by jcun4128 on Thursday October 12, 2017 @03:45AM (#15456329)
How do you deal with the legality of scraping?

I was hired to scrape some economic related pages and build an excel file and email it, I got that done but not sure if I should try to host this and turn it into a service or just set it up for the client and let them deal with it. It's just personal use on their part.

Re:Ask HN: What non-work task have you automated? by dotdi on Thursday October 12, 2017 @04:45AM (#15456558)
I would not equate scraping with periodic searching for a keyword.

The problematic part is when you scrape data off of websites, and the owners don't want you to do it; as in, they would not even be happy if you manually copied that stuff into an excel file for fun or profit.

Re:Ask HN: What non-work task have you automated? by jcun4128 on Thursday October 12, 2017 @05:13AM (#15456671)
I can see that, although automating to decrease views of a page(from checking by refresh)... I suppose the end result is sign up in this case.

So for me I'll set it up for them and them run it.

Re:Ask HN: What non-work task have you automated? by amelius on Thursday October 12, 2017 @05:36AM (#15456748)
> How do you deal with the legality of scraping?

How did Google deal with it, when they started their search engine business?

Re:Ask HN: What non-work task have you automated? by jcun4128 on Thursday October 12, 2017 @05:53AM (#15456818)
My counter to this is, without Google's "algorithm" the search results would not be great/find what you want. And in this case websites want to volunteer/agree to index their site for visibility but then you still have to visit the site because conveniently The site summary ends before the content that you want. I don't know how I would find websites unless referred on some website.

I kinda felt the same way about how Netflix started out but I think they probably had a deal to pay a portion of revenue from dvd's that they rented out.

Re:Ask HN: What non-work task have you automated? by benji-york on Thursday October 12, 2017 @09:04AM (#15457630)
robots.txt
Re:Ask HN: What non-work task have you automated? by gspetr on Thursday October 12, 2017 @09:23PM (#15462679)
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @12:37AM (#15455708)
Because this was very important to me and my life forward, I thought it was better to roll my own custom notifier. Moreover, the phone call thing was the most important part which will get attention any time of the day than an email.
Re:Ask HN: What non-work task have you automated? by joho68 on Thursday October 12, 2017 @06:35AM (#15456963)
So bounce your (unique) e-mail to an SMS-forwarder :)
Re:Ask HN: What non-work task have you automated? by evook on Thursday October 12, 2017 @08:34AM (#15457492)
I like the telegram API :)
Re:Ask HN: What non-work task have you automated? by captaintacos on Wednesday October 11, 2017 @11:53PM (#15455547)
Cool! Thanks for that Already using it to track whenever a couple stores here in Japan put the Nintendo Switch back in inventory or lottery sale
Re:Ask HN: What non-work task have you automated? by mrhappyunhappy on Wednesday October 11, 2017 @08:09PM (#15454654)
This is awesome, thank you.
Re:Ask HN: What non-work task have you automated? by zeristor on Thursday October 12, 2017 @01:00AM (#15455781)
No Hololens events in London, is that by design?
Re:Ask HN: What non-work task have you automated? by richev on Thursday October 12, 2017 @06:12AM (#15456881)
Wait a while...it took about six months for one to happen here in Sydney. Well worth the wait - half an hour of exclusive use of a Hololens. All the while being recorded for market research purposes, but that seemed like a fair trade.
Re:Ask HN: What non-work task have you automated? by pfalke on Wednesday October 11, 2017 @06:55PM (#15454272)
Did the same thing to get a wedding registration appointment with the Berlin city administration, but used Ghostery instead of AWS+Twilio. The responsible administration department currently doesn’t give out appointments and advises not to plan weddings because they are so understaffed, but I didn’t feel like waiting. Got a notification email from Gostery in the middle of the night, registered the only available slot et voilà!
Re:Ask HN: What non-work task have you automated? by zeristor on Thursday October 12, 2017 @01:07AM (#15455798)
Isn’t Ghostery an ad-blocker?

I can’t see anything else with that name. All the references in this thread are great tips, so I’d like to track this one down too.

Re:Ask HN: What non-work task have you automated? by pfalke on Thursday October 12, 2017 @01:51AM (#15455934)
Thanks for commenting - it was Ghost Inspector
Re:Ask HN: What non-work task have you automated? by arkades on Wednesday October 11, 2017 @08:07PM (#15454639)
Can you please elaborate on the state of your bureaucracy. It'll make me feel better about American politics.
Re:Ask HN: What non-work task have you automated? by orbifold on Thursday October 12, 2017 @02:19AM (#15456019)
I think it is a passing thing. Germany recently legalized Gay marriage and presumably that lead to a huge backlog of gay people finally wanting to marry.
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @12:43AM (#15455726)
So we both had life changing events. Its the real winning moment of a programmer when he is able to use his/her skills for a "non-work" task automation. Its more satisfying.
Re:Ask HN: What non-work task have you automated? by tathagatadg on Wednesday October 11, 2017 @07:19PM (#15454401)
I did a very similar thing to check if my H1B was approved. My use case was simpler - I regexp matched a keyword on the webpage and converted the script to an alexa skill deployed locally. Unfortunately, i wasn't home for the week when the approval happened :P. But it was fun asking alexa to check the status!
Re:Ask HN: What non-work task have you automated? by zeristor on Thursday October 12, 2017 @01:12AM (#15455812)
I’ve tweaked Gmail filter settings so some Meetup invites appeared as a phone alert, ie nearly everything else filtered into no alert.

London Meetup fill up within minutes that many data science ones allot tickets “randomly” via lottery.

Surely this is a market opportunity?

Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @01:21AM (#15455850)
The problems are too fragmented for a generic alert service to solve.
Re:Ask HN: What non-work task have you automated? by Tepix on Thursday October 12, 2017 @08:11AM (#15457362)
Did something similar to check availability of a special deal by my ISP.

No need to write code, you only need a shell account on a box somewhere. Put a line like this in your crontab:

    20 9,12,15,18,21 * * * curl -s http://example.com/special-deal-page | grep 'something that needs to appear on the page' | mailx -E -s "it's happening!1!" $MAILTO
This will check every three hours during daytime (which is what I wanted). "mailx -E" will only send an email if the input is not empty. Don't forget to define MAILTO and to test the contraption.
Re:Ask HN: What non-work task have you automated? by lamby on Thursday October 12, 2017 @10:40PM (#15462929)
This is pretty much exactly how my https://github.com/lamby/gumtree-sniper works
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @10:37AM (#15458262)
Pretty concise. I needed a loud phonecall, so used twilio free developer account for that.
Re:Ask HN: What non-work task have you automated? by clay_to_n on Thursday October 12, 2017 @07:16AM (#15457136)
I used this same technique to apply for an early interview for the U.S. CBP's Global Entry program. Someone already open-sourced the tool, then I set up a cron job to run it: https://github.com/davidofwatkins/ge-cancellation-checker
Re:Ask HN: What non-work task have you automated? by tonyarkles on Wednesday October 11, 2017 @05:18PM (#15453571)
Did you make it to SK? There's a few of us here, but not that many...
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @12:54AM (#15455756)
Yes, made it to SK, but moved to Montreal for better job prospects. Probably will have to move to Toronto because my spouse's can't find a good job due to the strict French language requirements for non IT jobs in Quebec.
Re:Ask HN: What non-work task have you automated? by jerrygoyal on Thursday October 12, 2017 @05:01AM (#15456615)
I've heard that you need to stay in that province (min 2 yrs) if you go through pnp program. then how come you moved to Quebec?
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @08:19AM (#15457417)
It’s express entry after provincial nomination. Once PR is given and landed, you are free to move and work anywhere in Canada.
Re:Ask HN: What non-work task have you automated? by mandeepj on Wednesday October 11, 2017 @07:29PM (#15454465)
Congrats. It is for sure a life changing hack.

Not sure why you choose to do diff? You could have just searched the dom for the existence of 'Apply' button? Am i missing something?

Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @12:49AM (#15455741)
Frankly, I didn't think much. Just wrote this script in an impulse of a moment when I missed a slot. During that time, I didn't think about how it was done, but the end result. Sure diff would have triggered false positives, luckily didn't get any.
Re:Ask HN: What non-work task have you automated? by worldsayshi on Thursday October 12, 2017 @03:40AM (#15456312)
Perhaps you didn't know how the button was supposed to look like? Seems like it's better to get false positives than to miss it.
Re:Ask HN: What non-work task have you automated? by briandear on Thursday October 12, 2017 @07:14AM (#15457129)
To be clear, H1B isn’t an immigrant visa. It’s a temporary skilled worker visa. There are other visas designed for skilled immigrants. Someone on an H1B isn’t an immigrant so of course the system would be “broken” when expecting H1B to result in a green card. It’s no different than expecting a tourist visa to be the first step to getting a residency visa. H1B was never implemented as a pathway to permanent residency.

Still that aside, great ‘hack’ and congrats on getting your Canadian residency!

Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @08:17AM (#15457406)
Thats wrong information. H1B is a “dual intent” visa.

Its broken because it was really intended for exceptionally skilled workers. But currently its a lottery. USCIS just takes the word of the company applying for it and grants the visa. This loophole is being exploited by numerous body shops. That is reason why there are low quality H1B workers. There are various other problems like employee mobility, spouses of H1B is not free to work in the land of the free. Country of birth based quotas for permanent residency, rather than skills or points based quotas.

Re:Ask HN: What non-work task have you automated? by godelmachine on Wednesday October 11, 2017 @09:35PM (#15455037)
Could you please upload your code on GitHub? May I ask your github profile?
Re:Ask HN: What non-work task have you automated? by jcun4128 on Thursday October 12, 2017 @03:48AM (#15456344)
You could write this with simpledomhtlm + php + cron or a raspberry pi (cron) and then send yourself a webhook notification via slack or configure mailgun (mailing client) or firebase android notification (haven't done this).

Inspect the page,find the structure, isolate or if it is easier to just dump the entire plaintext and use strpos to find a specific word.

Re:Ask HN: What non-work task have you automated? by hi41 on Thursday October 12, 2017 @08:43PM (#15462547)
It made me so happy to read your post! That is such an amazing idea!
Re:Ask HN: What non-work task have you automated? by nnd on Thursday October 12, 2017 @04:39AM (#15456529)
Is that for Saskatchewan Immigrant Nominee Program?
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @10:17PM (#15462847)
Yes. SINP in short.
Re:Ask HN: What non-work task have you automated? by snadwich on Wednesday October 11, 2017 @04:22PM (#15453118)
Why don't you convert this into a paid service? Sounds amazing!
Re:Ask HN: What non-work task have you automated? by t1o5 on Wednesday October 11, 2017 @04:35PM (#15453217)
I did, hosted at sinpnotifier.com, Saskatchewan province is not that attractive for skilled immigrants. Had one sale though, then I shut it down.
Re:Ask HN: What non-work task have you automated? by justboxing on Wednesday October 11, 2017 @04:39PM (#15453255)
> Why don't you convert this into a paid service

and

> I did, ...Had one sale though

Yeah, was about to say, it's too small of a niche. Plus the risk that sooner or later, Saskatchewan would update their site to provide the same feature.

Re:Ask HN: What non-work task have you automated? by t1o5 on Wednesday October 11, 2017 @04:55PM (#15453393)
Yes, too small of an audience to sell it to. Also I didn't care about the timezones in the script. It will make the call no matter in which timezone you are in (you will get the call in the middle of the night), because Saskatchewan's site do not care, it will close when the quota gets filled and it gets filled fast, within hours !
Re:Ask HN: What non-work task have you automated? by taneq on Wednesday October 11, 2017 @10:34PM (#15455264)
Well, you'd want to make it a /bit/ more generic, surely? Like, "load this url and send a text to this number if the (page text | diff) matches this regexp"?

Even allow people to create presets that would then be added as a generic thing. You could use it for camping all sorts of intermittent online things (web site specials, online ticket pre-orders, etc.)

Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @01:00AM (#15455780)
There are many sites which already does this. During that situation when I missed a slot, I didn't want to take any chances again by using sites like visualping. I trusted my script and twilio API to work.

First I thought to ring a loud alarm connected with a Pi, but then it will be limited to my apartment. So I went with twilio to give me a phone call. Because I should act immediately and time was of the essence. Emails or SMS might go unnoticed.

Re:Ask HN: What non-work task have you automated? by parthdesai on Wednesday October 11, 2017 @04:40PM (#15453263)
Maybe you didn't market it to right crowd? I know a lot of South Asian people who go to Saskatchewan just to get their PR.

There are a lot of Software Engineering/Development jobs in Toronto or bigger cities so people in those fields wont leave these bigger cities.

Re:Ask HN: What non-work task have you automated? by t1o5 on Wednesday October 11, 2017 @04:47PM (#15453330)
The problem with monetizing this service is because there are many immigration watsapp groups with many members in it. So when one member buys this service, he can simply broadcast this notification to his watsapp groups. I even made the service free, but no takers. Anyways it worked for me, changed my life !
Re:Ask HN: What non-work task have you automated? by parthdesai on Wednesday October 11, 2017 @05:27PM (#15453643)
Ah fair enough. Glad it all worked out for you. I did choose Canada ( well, my dad) for undergrad because of easier immigration policy.
Re:Ask HN: What non-work task have you automated? by t1o5 on Thursday October 12, 2017 @12:34AM (#15455694)
You took the right decision. (well, your dad).
Re:Ask HN: What non-work task have you automated? by WillReplyfFood on Thursday October 12, 2017 @02:29AM (#15456054)
This is interesting - as there do no longer exist equal opportunities between the different castes with this.

Saddle the lawyers, we ride at dawn!

Re:Ask HN: What non-work task have you automated? by pc86 on Thursday October 12, 2017 @08:22AM (#15457427)
Using one's intelligence and skills to better your life should be celebrated, not lamented as evidence of burdening some other "caste."
Re:Ask HN: What non-work task have you automated? by mosselman on Thursday October 12, 2017 @03:03AM (#15456177)
I get what you mean, but the same might be said for someone being able to check manually every 10 minutes. Then there is no equal opportunity between the working and workless classes.
Re:Ask HN: What non-work task have you automated? by plshlpme on Wednesday October 11, 2017 @09:47PM (#15455082)
Hey, I would be willing to pay for such service. How should I contact you? My contact details are in my profile. Plshlpme