[ / / / / / / / / / / / / / ] [ dir / britfeel / dempart / doomer / mewch / o / vfur / vril / wmafsex ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
Verification *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 7302db6f1b10b13⋯.jpg (164 KB, 1567x741, 1567:741, Tired.jpg) (h) (u)

[–]

 No.1057678>>1057773 >>1057802 >>1057822 >>1057902 [Watch Thread][Show All Posts]

So I am looking to automate some task but I am having trouble finding what I really need on Google and dont really know where to begin otherwise.

At the job I work at, I receive automated text messages everyday asking if I'd like to pick up an extra shift. The problem is that they only give out extra shifts to so many people before locking the form.

What ends up happening is

>get text message containing web page to accept available extra shift.

>click on link

>opens chome

>login in

>click shift form button, click accept, click confirm

>all spots have been taken, try later.

>rage.jpg

On top of not being fast enough to open the link, the company sends the once daily text at random times during the night and day.

What I need is something that

>automatically detects text messages received from a specific number.

>opens link in most recent text

>auto login to webpage

>accepts the shift for me

I'd like to set this up and forget about it. An on/off switch would be nice for those days I don't want to work a double shift.

I don't know how to code and I'm not familiar with any coding apps.

If I knew how to pull links from the text messages on my phone it would be a lot easier.

 No.1057687

Sorry about the Reddit spacing. I copy/pasted my post from /g/ and didn't realize it would do that.


 No.1057720

OP is a faggot


 No.1057773

>>1057678 (OP)

python


 No.1057802>>1057822

>>1057678 (OP)

I'm not going to do your work, but here are some pointers:

>automatically detects text messages received from a specific number.

You would need to hook up your messenger so that it runs a script when a message arrive. That script would look at the message, match some criteria and if it does detect a match continue, otherwise do nothing. I would guess that messages are stored in a directory, so if your messenger has no way of hooking up plugins you could use a daemon that monitors the directory of messages for changes. When a change is detected it would feed the file into the script.

>opens link in most recent text

A simple regex could search for the URL, which can then be sent to a web browser as an argument, like how you can type "firefox https://8ch.net" on the command line and Firefox will open this site.

>auto login to webpage

>accepts the shift for me

Now here is where it gets complicated. There are headless web browsers, those are web browsers with no visible interface. Firefox has a headless mode, but you are probably better off using a browser that was meant to be used headless. I know of PhantomJS, which can be scripted in Javascript, but I never used it myself.

http://phantomjs.org/

You will have to figure out how to make the browser find shifts and how to select a shift. I hope this gives you an idea how to solve your problem. Always break up a large problem into smaller ones and use the right tool for the job.


 No.1057822

>>1057678 (OP)

>>1057802

>You will have to figure out how to make the browser find shifts and how to select a shift.

If the page always looks the same it would be easier but slower to have xdotool do it.

Defcon talk kinda related to your problem OP

https://youtu.be/sgz5dutPF8M


 No.1057824

Download the form page html of several message links.

Compare differences

Create your own version to submit data

Add functionality if needed via jquery

Steal cookies if needed

Add trigger event/daemon/etc to fire when SMS recieved

You may find the form accepts GET instead of POST so you could simply parse the SMS and construct a 'submit-in-URL' to open and register automatically.


 No.1057827

Vague shit is vague. You probably can't find anything related because you haven't broken down your problem into an algorithm, as you should.

1. You receive the text message. I'm assuming it's on your phone? If so, a script can be launched from Termux but I suppose you'd have to give it more permissions. Another option would be to make your own program (in case of Android, Kotlin would be the way to go).

2. Do you fiddle with browser automation or do you work with web requests directly? Open up the inspector and take the page apart, specifically: how the page is loaded (any extra content loaded via JS post-pageload), how the login form works and is organized. If it looks simple enough, working with the web directly is less problematic.

3. Click Accept/Confirm. Again, take the page apart with inspector. Is the confirm button a pop-up? Does clicking accept send any AJAX requests or is it all just hidden/visible elements sending forms again. In case of the latter, working directly with HTML is better.

If you're going the Kotlin way, there are bound to be resources on HTML parsing and receiving/sending requests. You'd also need to look up managing permissions and hooking up a daemon to watch for incoming messages. Otherwise, a script in a language of your choice (Python/Go/whatever) that checks message storage and does the same, provided the program running the script has access to them.


 No.1057902

>>1057678 (OP)

If you receive the message on a email account, you can use python and selenium to login to the page and refesh every 5 seconds and get your bot to fill the form for you. This video is a bit low quality but it explains it nicely:

https://www.youtube.com/watch?v=OPXnIznhvVc

This one gives you the basics:

https://www.youtube.com/watch?v=GJjMjB3rkJM


 No.1058135

OP here

Thanks for all the advice guys. Seems I'll have to do quite a bit of homework to understand all this.

I Archived the thread for future reference. http://archive.is/ZNPjK




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
9 replies | 0 images | Page ?
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / britfeel / dempart / doomer / mewch / o / vfur / vril / wmafsex ][ watchlist ]