Hacker News new | past | comments | ask | show | jobs | submit login

I sometimes use my little service https://pushurl.43z.one/ If I need to notify my desktop browser or phone with a notification triggered by some code.

I just go to the website with my browser click generate. Then in my script I do `curl $pushurl?title=jobdone`. When it gets triggered a notification popups on my phone that says "jobdone".

It uses the native browser web push API so I don't need to install anything extra.




Awesome! Using it now. So seamless. Are there any other parameters besides `title`?

_edit:_ wrote a little Bash function for this; seems to work well:

  function notify() {
    argTitle='TerminalNotification'
    argText="$1"
    argUrl='https://www.example.com'
  
    baseUrl='https://pushurl.43z.one/XXXXXXXXXXXXX'
  
    curl --get \
         --data-urlencode "title=$argTitle" \
         --data-urlencode "text=$argText"   \
         --data-urlencode "url=$argUrl"     \
         $baseUrl
  }


just `title`, `text` and `url` (which will open the specified `url` on notification click)


Neat. I guess you had to visit pushurl.43z.one once with each browser you want to be notified right?

I'm just curious.


Yes, exactly. The pushurl has to be generated with the browser on the device which you want send notifications to. The pushurl is bound to that browser.


Is the code public? Seems simple to implement. But I'd rather copy and paste.


No, I'm too lazy to make it available publicly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: