Lurker News
For my travel site side hustle (beatthatflight.com.au/), I find and publish cheap flights for Australians. Sounds simple, but even if say, someone gave me the flights each day, there's posting the, sometimes to deals sites, as well as then editing it and posting it on my site, and out to social media, and then to specific mailing lists on mailchimp, depending on the source city of the deal, or type of post.

A LOT of that becomes tedious. Mailchimp can auto post to FB/twitter/instagram etc, but even converting the blog post into mailchimp emails gets tiring, as you need to choose a feature photo, the specific mailing list etc.
I'm a selenium guy, so have built some scripts to minimise some of it, but the rush each time of finding a deal still pains me when I think of the tedium ahead of publishing it.
Ideally, my goal would be to submit [to][from][when] to a script and the whole process would be automatic. I can see that selenium could do it, but my goodness, it'd be slow and potentially flaky all via the web UI for those sites.
I'd love suggestions, examples of automation you've done, and tools used?

Comments (229) 59 threads

Earlier comments
benibela#
I spend a lot of time with web automation

Especially for public library catalogues. There the webpage shows when the borrowed books are due, and you need to check it every week, or pay late fees. And you cannot set a bookmark, since you need to login first, which is tedious. So I automated it to renew all books and show me a warning.
And because that needs to run silently everyday, I decided to make it as fast as possible (and because I only had a single core cpu with less than 1gb ram). No browser, no javascript, no selenium, no python, no java. Only viable languages would be C or Pascal, and for memory safety I implemented everything in Pascal.
Because it is also tedious to build HTTP requests in native code and recompile it all the time, I then wrote a scripting language for it, all the webscraping is done in the script, but it is still fast because the processing is done in native code.
To read data from the HTML, I use pattern matching, e.g. + would read all links, and foo+ would read all links with text foo.
Nowadays I do not even visit public libraries anymore, but the automation tool has become an open-source project at http://www.videlibri.de/xidel.html .
I also started playing some browser games, but they are boring, so I stopped. But I want to stay in the highscore list, so I wrotes bot for them. Because they have anti cheat detections, you cannot send the http requests directly. For javascript based games, I wrote a bot with Greasemonkey. For flash games that does not work, so I have decompiled the flash file, added the automation functions to the flash, and then recompiled it.

JshWright2 replies#
I use Home Assistant to automate a lot of stuff around my house. The one I use at least daily is a trigger based on the light switch in my bedroom. A double click down triggers an automation that turns off all the lights in the rest of the house, makes sure the garage doors are closed, and that the rest of the doors are locked.
patrickk5 replies#
One future Home Assistant project that I would love to implement is a whole house lighting system that gradually transitions all the lights from white/blue in the morning, to yellow/orange in the evening to aid natural melatonin production. Such a project would have to be fully automated, otherwise I'd forget to set it each day. Blue LEDs are terrible for sleep and throw off your body's natural sleep pattern. I got the idea from the excellent book "Why We Sleep"[1]. It's possible that a similar HA project already exists.

[1] https://en.wikipedia.org/wiki/Why_We_Sleep

bonestamp21 reply#
Look into philips hue. You can set the lights so they turn on at a different color temperature depending on time of day. Some of the remotes/switches even come pre-programmed to do that right out of the box.
patrickk#
Good to know thanks.
patrickk#
Wow, very nice. This looks like exactly what I had in mind.
egypturnash#
You can do this with a bunch of any “smart” bulb that supports schedules. It is not very hard.

I used to have a little script running on my computer that changed one bulb’s color based on local weather forecasts and the time, so that I never had a screamingly bright light telling me it was about to rain in the middle of the night. That’s when it starts to get vaguely complicated.

smolder#
I did this with good results, using warm white and daylight white LED strips, a couple of PWM dimmers, and an arduino, at a former apartment a few years ago. I have a similar setup now but it's a single LED strip featuring both color temps, with its own remote controllable dimmer for brightness/color temp; I haven't bothered to automate it.
bonestamp2#
I use a lot of automation around my house too. I noticed that my wife and kids tend to leave certain lights on frequently, so I replaced them with motion sensor switches that automatically turn on/off the lights. Having them turn on the lights became a very nice feature.

I also have all the outside lights on wifi light switches that turn on automatically at dusk. There are a few lamps inside that turn on automatically too, so it looks like someone is home and so it automatically creates a nice ambiance when we are home.
The lamps also happen to use RGB Hue bulbs, so they're normally a white shade, but if one of the outside motion sensors (also Hue) is triggered, then they turn red, and if it's late enough that the outdoor lights are off, then it automatically triggers the wifi light switches to turn on all the outside lights.
Amazon echo show is great for checking cameras. Logitech harmony remote is great for starting up the tv/media box/amplifier and configuring them to their correct settings each time someone wants to watch tv. The automatic refill kit for the keurig keeps the water tank full. myQ lets me know if one of my garage doors was left open. A wemo plug turns on my hot water circulator during the hours when we're usually home and off when we're not. Nest camera lets me know when it spots a person on my driveway.

dana321#
You mention selenium, i use Selenium IDE

Its a browser plugin that allows you to record and playback anything that you do in your browser.
https://selenium.dev/selenium-ide/
There is a right-click action to record hovering over a section if it is hidden by css, its a well-known gotcha in wordpress admin listings and other sites that love to hide until you hover over a section.
I've still to look into whether the file format that is saved from selenium ide could be used within a virtual browser like phantomjs or the like.
For direct scraping, i tend to go straight to xpath with dom.
Its far more reliable than trying to get stuff out via regular expressions, that i only use when i need to get a certain part of the node value from a text node.
I used to use php for that, but i wrote my own programming language that uses a library called htmlquery (its a go library)
https://github.com/antchfx/htmlquery
If i have to login, i fake each request with the correct headers. Plenty of libraries around that help with that for every language.

Oldham-Made2 replies#
I threw together a quick python script which scrapes listings from cinemas local to me, along with each movie's IMDB score, and compiles the results into a weekly Friday-morning email which I send to myself and my SO.

It's nice to know what movies are out, and when we can book, without having to remember to check or wait for pushy emails from the cinemas themselves.
I'm planning on doing the same to email us the latest menus from our favourite restaurants/cocktail bars so we can see when they change.

gurjeet#
Would love to see this turned into a website that does recommendations based on zip code.
dueyfinster#
I've done various versions of this myself, would you mind sharing your code?

Load more comments