Sending notifications from Pharo to your Mobile via Pushover.net
Hi, Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with. This is how you do it from Pharo: ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post. It will look like this on your mobile device (just seconds later): Nothing special, but pretty handy. Sven -- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
Cool sven Is is a problem that you send you token/user around? Can I publish it on pharo weekly like that? Stef On Mon, Jan 29, 2018 at 8:40 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
On 29 Jan 2018, at 21:04, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Cool sven Is is a problem that you send you token/user around? Can I publish it on pharo weekly like that?
These are not my real key ;-)
Stef
On Mon, Jan 29, 2018 at 8:40 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote: Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
<PastedGraphic-1.png>
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
What is the difference between Pushover and other similar services? Do you need a Pushover client in the phone to handle such notifications? Nonetheless, the conciseness of Pharo with Zinc never ceases to amaze me. Regards! Esteban A. Maringolo 2018-01-29 16:40 GMT-03:00 Sven Van Caekenberghe <sven@stfx.eu>:
Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
Based on the icon and my mobile dev experience ... Either you need the Pushover app (hence the 'P' icon) to get a push notification or you can make your mobile app the recipient of the push notification (like UrbanAirship does) by including a library in your mobile app. For SMS I generally use Twilio or Plivo - either is a perfectly decent SMS service. Twilio and Plivo have similar REST apis and would have similar looking calls. -Todd Blanchard
On Jan 29, 2018, at 12:34 PM, Esteban A. Maringolo <emaringolo@gmail.com> wrote:
What is the difference between Pushover and other similar services? Do you need a Pushover client in the phone to handle such notifications?
Nonetheless, the conciseness of Pharo with Zinc never ceases to amaze me.
Regards!
Esteban A. Maringolo
2018-01-29 16:40 GMT-03:00 Sven Van Caekenberghe <sven@stfx.eu <mailto:sven@stfx.eu>>: Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net <https://pushover.net/>) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json <https://api.pushover.net/1/messages.json>'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
<PastedGraphic-1.png>
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org <http://pharo.org/> http://association.pharo.org <http://association.pharo.org/> http://consortium.pharo.org <http://consortium.pharo.org/>
On 29 Jan 2018, at 21:34, Esteban A. Maringolo <emaringolo@gmail.com> wrote:
What is the difference between Pushover and other similar services? Do you need a Pushover client in the phone to handle such notifications?
Yes, you need to install their client, which then acts as a generic receiver of notifications, but you can customise them a bit. Personal license is $5 for life. It is too new for me to have a real opinion about it, but it looks cool & simple.
Nonetheless, the conciseness of Pharo with Zinc never ceases to amaze me.
Yeah, that is why I keep posting snippets like that.
Regards!
Esteban A. Maringolo
2018-01-29 16:40 GMT-03:00 Sven Van Caekenberghe <sven@stfx.eu>: Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
<PastedGraphic-1.png>
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
If you need more than just a simple push notification you can try Discord to send text, pictures, ... into own discord server and channels. Or work with Bots. Code is here https://github.com/JurajKubelka/DiscordSt and techtalk video here: https://www.youtube.com/watch?v=y1EzOnfHUe0 Maybe some of you already have the Discord app on the mobile anyway (for Pharo) Bye T.
Gesendet: Montag, 29. Januar 2018 um 23:44 Uhr Von: "Sven Van Caekenberghe" <sven@stfx.eu> An: "Any question about pharo is welcome" <pharo-users@lists.pharo.org> Betreff: Re: [Pharo-users] Sending notifications from Pharo to your Mobile via Pushover.net
On 29 Jan 2018, at 21:34, Esteban A. Maringolo <emaringolo@gmail.com> wrote:
What is the difference between Pushover and other similar services? Do you need a Pushover client in the phone to handle such notifications?
Yes, you need to install their client, which then acts as a generic receiver of notifications, but you can customise them a bit. Personal license is $5 for life. It is too new for me to have a real opinion about it, but it looks cool & simple.
Nonetheless, the conciseness of Pharo with Zinc never ceases to amaze me.
Yeah, that is why I keep posting snippets like that.
Regards!
Esteban A. Maringolo
2018-01-29 16:40 GMT-03:00 Sven Van Caekenberghe <sven@stfx.eu>: Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
<PastedGraphic-1.png>
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
I tried running this after loading NeoJSON and I got a DNU on 'ZnEntity json:' in a new Pharo 6.1 64 bit on Mac OS. What else needs to be loaded? On Mon, Jan 29, 2018 at 11:40 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
On 30 Jan 2018, at 10:26, john pfersich <jpfersich@gmail.com> wrote:
I tried running this after loading NeoJSON and I got a DNU on 'ZnEntity json:' in a new Pharo 6.1 64 bit on Mac OS. What else needs to be loaded?
You need a more recent version of Zn. The convenience method in question was add in the summer === Name: Zinc-HTTP-SvenVanCaekenberghe.463 Author: SvenVanCaekenberghe Time: 20 July 2017, 1:56:29.265299 pm UUID: b280062d-2011-0d00-a5c4-90050753dde5 Ancestors: Zinc-HTTP-SvenVanCaekenberghe.462 Add ZnEntity class>>#json: and ZnStringEntity class>>#json: ===
On Mon, Jan 29, 2018 at 11:40 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote: Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new systemPolicy; url: 'https://api.pushover.net/1/messages.json'; accept: ZnMimeType applicationJson; contentReader: [ :entity | NeoJSONObject fromString: entity contents ]; contentWriter: [ :object | ZnEntity json: object asString ]; contents: (NeoJSONObject new token: 'ax4o55o6g5imb1a6st3m9x34hqu44z'; user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw'; title: 'Test 3'; message: ('This is a test @ {1} by {2}.' format: { DateAndTime now. SystemVersion current })); post.
It will look like this on your mobile device (just seconds later):
<PastedGraphic-1.png>
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
Great stuff! On 30/01/2018 6:10, Sven Van Caekenberghe wrote:
Hi,
Just a little snippet I wanted to share. Pushover (https://pushover.net) is a general service that delivers notifications to iOS, Android and desktop devices via an API (and an email gateway as well). It is really easy to get started with.
This is how you do it from Pharo:
ZnClient new  systemPolicy;  url: 'https://api.pushover.net/1/messages.json';  accept: ZnMimeType applicationJson;  contentReader: [ :entity | NeoJSONObject fromString: entity contents ];  contentWriter: [ :object | ZnEntity json: object asString ];  contents: (NeoJSONObject new         token: 'ax4o55o6g5imb1a6st3m9x34hqu44z';         user: 'uv2fovx3f9sp3rgssrupvjgvdo8quw';         title: 'Test 3';         message: ('This is a test @ {1} by {2}.' format: {               DateAndTime now. SystemVersion current }));  post.
It will look like this on your mobile device (just seconds later):
Nothing special, but pretty handy.
Sven
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org
participants (7)
-
Esteban A. Maringolo -
john pfersich -
Markus Stumptner -
Stephane Ducasse -
Sven Van Caekenberghe -
Todd Blanchard -
Torsten Bergmann