how to send data online from my script?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mauritius
Posts: 25
Joined: 06 Nov 2020, 14:00
Contact:

how to send data online from my script?

Post by mauritius » 23 Dec 2021, 03:44

Hi guys, maybe you can help me address this issue:

I created a script which will be used by many users. Therefore I want to check some usage statistics from these scripts. How can I do it?
I thought about sending it online to my website - but I don't know how to upload a file or just some text to my server or website. I only know how to download things from the web (with URLDownloadToFile method). Maybe someone can help me how to upload a file?
Or maybe some other way? I thought about accessing some unique URL where there would be data in URL parameters, but it would require some analysis of my website logs or some external tools. If possible, I would like to avoid it.

Can you please point me in some direction?

Thanks in advance for any help!
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: how to send data online from my script?

Post by mikeyww » 23 Dec 2021, 04:46

You could download a file that no one else would ever download, or just access a page, and then examine the server logs for hit counts. You could send an e-mail message to yourself from the script. You would need to decide what to do when the person is offline. Of course, you could also access an online database, but it might require more setup.
mauritius
Posts: 25
Joined: 06 Nov 2020, 14:00
Contact:

Re: how to send data online from my script?

Post by mauritius » 23 Dec 2021, 23:52

Yes, but I don't got enough skills for analysing the server logs :(
Accessing a database - I would prefer to avoid it because it seems like a big canon when you only want tot shoot a bird.

But is this possible to upload a file in ahk - similarly to the way you download a file?
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: how to send data online from my script?

Post by amateur+ » 24 Dec 2021, 00:36

Send Telegram messages from your bot.
Here is an example (but use POST method): https://www.autohotkey.com/docs/commands/URLDownloadToFile.htm#XHR
And here is the link for Telegram Bot API.
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: how to send data online from my script?

Post by mikeyww » 24 Dec 2021, 06:07

The e-mail approach is also very simple. The forum has posts with functions and examples already created.
mauritius
Posts: 25
Joined: 06 Nov 2020, 14:00
Contact:

Re: how to send data online from my script?

Post by mauritius » 25 Dec 2021, 00:08

Can you please share a link to this solution or tell what to search for?
The problem with email approach is that it requires me to manage the data manually. On the other hand - if I could only upload a text file - I could write a script to manage it automatically. That's why I ask for that kind of solution.

Any other ideas?
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: how to send data online from my script?

Post by amateur+ » 25 Dec 2021, 05:07

I think if you want to upload files somewhere you should look for API documentation of that "somewhere".
As for emails mikeyww is right: it is simple and I suppose more reliable than sending via Telegram bot.
Links you were asking for (I've found them in google):

EmailSender
https://www.the-automator.com/downloads/emailsender/

(4) Sending email with AHK - AutoHotkey Community
viewtopic.php?t=30889

(4) Blat Email dll - AutoHotkey Community
viewtopic.php?f=5&t=30299&p=141859&hilit=Blat.exe#p141859

(4) Send an email - AutoHotkey Community
viewtopic.php?t=7736

How to Send email using AHK? Blat? - Ask for Help - AutoHotkey Community
https://www.autohotkey.com/board/topic/79360-how-to-send-email-using-ahk-blat/

Simplest way for AHK to send email from gmail.com - Ask for Help - AutoHotkey Community
https://www.autohotkey.com/board/topic/81162-simplest-way-for-ahk-to-send-email-from-gmailcom/

CDO COM - Email Delivery [AHK_L] - Scripts and Functions - AutoHotkey Community
https://www.autohotkey.com/board/topic/60813-cdo-com-email-delivery-ahk-l/
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
mauritius
Posts: 25
Joined: 06 Nov 2020, 14:00
Contact:

Re: how to send data online from my script?

Post by mauritius » 25 Dec 2021, 05:47

Thanks for the links, amateur+, I'll check them.

By "somewhere" I meant my website, I should be more precise.
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: how to send data online from my script?

Post by amateur+ » 31 Dec 2021, 10:05

Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
mauritius
Posts: 25
Joined: 06 Nov 2020, 14:00
Contact:

Re: how to send data online from my script?

Post by mauritius » 31 Dec 2021, 10:12

@amateur+ thank you for remembering!
all the best for you in the new 2022 year! a lot of health to you and other forum members :)
amateur+
Posts: 655
Joined: 09 Oct 2021, 15:43

Re: how to send data online from my script?

Post by amateur+ » 31 Dec 2021, 10:18

You too :)
Have found any drawback in my code or approach? Please, point it out. /The moderator ordered to remove the rest of the signature, I had obeyed.
And I really apologize for our russian president. Being a citizen of an aggressor country is very shameful. Personally I tried to avoid this trying to defend elections from fraud being a member of the election commission of one of the precincts but only was subjected to a hooligan attack and right before the vote count was illegally escorted from the polling station and spent the night behind bars (in jail) in a result of illegal actions of corrupt policemen.
Post Reply

Return to “Ask for Help (v1)”