0

Currently i am learning writing user scripts(Greasemonkey) and I am learning javascript on the side. So if this is something very easy I would like you to bear with me since i am starting out now

Here is my situation, I have written a userscript that monitors a website and calls onclick every 3~5 mins, which gives me new data. I scan for keywords and log them but sometimes I have to change some parameters of the website when a particular keyword has arrived. For this i have to check log every now and then.

Is there a way i can update or create a remote event using userscript. so i can maybe update a different website that the keyword has arrived or upload a json to myjson which i can use it to notify me on the phone.

this way i can work on other things while waiting for the keyword.

Thank you

Pradeep
  • 1
  • 1
  • I am not sure why writing userscripts and learning Javascript is separated into 2 different tasks for you. Your question is too broad. You can try using [AJAX](https://en.wikipedia.org/wiki/Ajax_(programming)), but the website/application you send data to will have to [have cross-domain requests enabled](https://en.wikipedia.org/wiki/Same-origin_policy). Further information can be found [here](https://stackoverflow.com/questions/17874730/how-to-make-cross-domain-request). – Pyromonk Jul 04 '17 at 01:06
  • Thank you i will check Ajax and the Cross-domain requests. I am testing the website so i use Userscript to somewhat automate it. This will enable me to work or learn something during this time. – Pradeep Jul 04 '17 at 01:19
  • @Pyromonk, GM_xmlhttpRequest is something that would work for me. is there any free website provider this works for ? thanks in advance – Pradeep Jul 04 '17 at 02:11
  • I've worked on userscripts for more than 7 years, and I've never used `GM_xmlhttpRequest`. I hardly see any reason to use a GreaseMonkey-specific variable when the purpose of a userscript is to create something that is cross-browser. I don't understand your last question. – Pyromonk Jul 04 '17 at 04:46
  • Thanks I used pastebin api to send my status via GM_xmlhttprequest and it works well for me :) – Pradeep Jul 09 '17 at 23:52
  • I'm glad to hear that. My apologies if I wasn't helpful enough. – Pyromonk Jul 10 '17 at 01:30

0 Answers0