Re: [web2py] Re: Push Notifications

2020-11-20 Thread António Ramos
Yes you make an app in web2py that subscribes to one or many pusher
notification channels. That channels are created by you in your html of
your web2py app.
 your web2py server sends notifications to pusher.com using python code
,and your webpages subscribes the same notifications using javascript. you
can go crazy and create rooms etc.
The docs from pusher are very informative.
Regards
António

Em sex., 20 de nov. de 2020 às 18:28, Christian Varas <
chriiisti...@gmail.com> escreveu:

> Hi! I need to implement this and receive the notifications in the phone
> android/iOS. For this do I need to make my own app? Or do you use an app
> who can subscribe to push notifications in pusher.com ?
> This is off topic but any recommendation is appreciated
>
> Cheers.
> Chris
>
> El El vie, 20 de nov. de 2020 a la(s) 13:45, mostwanted <
> godirao...@gmail.com> escribió:
>
>> Gratitude
>>
>> On Friday, November 20, 2020 at 10:33:10 AM UTC+2 Ramos wrote:
>>
>>> create a module inside web2py
>>> API_Pusher.py
>>>
>>> import pusher
>>>
>>> def pusher_client():
>>> return pusher.Pusher(
>>>   app_id='yourid',
>>>   key='yourkey',
>>>   secret='yoursecret',
>>>   cluster='eu',
>>>   ssl=True
>>> )
>>>
>>>
>>> Then inside your controllers
>>>
>>> from API_Pusher import pusher_client
>>> ...
>>> pusher_client().trigger('fileit', 'plannerPesos',  {'message':
>>> "PlaySound('ok')"})
>>>
>>> Em sex., 20 de nov. de 2020 às 07:41, mostwanted 
>>> escreveu:
>>>
 Hey Ramos, I was able to successfully register the app on pusher.com.
 towards step 4 its says i should copy this code:
 *CODE:*
 curl -H "Content-Type: application/json" \
  -H "Authorization: Bearer
 9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
  -X POST "
 https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes;
 \
  -d
 '{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello,
 world!"}}}'

 to my console! Which console is this one? My desktop console? I'm
 hosted with pythonanywhere.com, can i use the Bash console in my
 dashboard?

 On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:

> Thanks alot Ramos, think this will work, very little work needs to be
> done here, I'll try it out.
>
> On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:
>
>> Why reiventing the wheel ???
>> https://pusher.com/
>>
>> I use it with web2py and works like a charm
>>
>>
>> Em seg., 16 de nov. de 2020 às 08:44, mostwanted 
>> escreveu:
>>
>>> So far all I have been able achieve is asking the user for
>>> permission to send them notifications & if they accept all that happens 
>>> is
>>> that everytime they open the app they get a greetings notification,
>>> achieving that was not complicated because it was straight forward, I
>>> placed the code in my main.js script & it runs everytime the service 
>>> worker
>>> gets registered.
>>>
>>> *CODE:*
>>> Notification.requestPermission(result => {
>>>   if (result === 'granted') {
>>> showNotification('Welcome to My App™', 'Everything Services™')
>>>   }
>>> });
>>>
>>> function showNotification(title, message) {
>>>   if ('Notification' in window) {
>>> navigator.serviceWorker.ready.then(registration => {
>>>   registration.showNotification(title, {
>>> body: message,
>>> tag: 'my-app',
>>> icon:'/init/static/images/icon_192x192.png',
>>> badge:'/init/static/images/icon_128x128.png',
>>> vibrate: [200, 100, 200, 100, 200, 100]
>>>   });
>>> });
>>>   }
>>> }
>>>
>>>
>>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>>

 Has anyone been able to implement push notifications on their
 web2py apps?

 I need a working application with some examples on how to implement
 this for one of my applications.

 I've been looking at the "web-push-book (
 https://web-push-book.gauntface.com/how-push-works/)" but I cant
 put it together in my head.

 What I wanna achieve is relatively basic, I have an applivcation
 that offers information on services & products sold in my area, so 
 what I
 want is to be able to send notifications everytime a new service or 
 product
 is registered.

 If anyone has any idea on how I can easily implement this please
 help me.

 Regards;

 Mostwanted

>>> --
>>> 

Re: [web2py] Re: Push Notifications

2020-11-20 Thread Christian Varas
Hi! I need to implement this and receive the notifications in the phone
android/iOS. For this do I need to make my own app? Or do you use an app
who can subscribe to push notifications in pusher.com ?
This is off topic but any recommendation is appreciated

Cheers.
Chris

El El vie, 20 de nov. de 2020 a la(s) 13:45, mostwanted <
godirao...@gmail.com> escribió:

> Gratitude
>
> On Friday, November 20, 2020 at 10:33:10 AM UTC+2 Ramos wrote:
>
>> create a module inside web2py
>> API_Pusher.py
>>
>> import pusher
>>
>> def pusher_client():
>> return pusher.Pusher(
>>   app_id='yourid',
>>   key='yourkey',
>>   secret='yoursecret',
>>   cluster='eu',
>>   ssl=True
>> )
>>
>>
>> Then inside your controllers
>>
>> from API_Pusher import pusher_client
>> ...
>> pusher_client().trigger('fileit', 'plannerPesos',  {'message':
>> "PlaySound('ok')"})
>>
>> Em sex., 20 de nov. de 2020 às 07:41, mostwanted 
>> escreveu:
>>
>>> Hey Ramos, I was able to successfully register the app on pusher.com.
>>> towards step 4 its says i should copy this code:
>>> *CODE:*
>>> curl -H "Content-Type: application/json" \
>>>  -H "Authorization: Bearer
>>> 9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
>>>  -X POST "
>>> https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes;
>>> \
>>>  -d
>>> '{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello,
>>> world!"}}}'
>>>
>>> to my console! Which console is this one? My desktop console? I'm hosted
>>> with pythonanywhere.com, can i use the Bash console in my dashboard?
>>>
>>> On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:
>>>
 Thanks alot Ramos, think this will work, very little work needs to be
 done here, I'll try it out.

 On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:

> Why reiventing the wheel ???
> https://pusher.com/
>
> I use it with web2py and works like a charm
>
>
> Em seg., 16 de nov. de 2020 às 08:44, mostwanted 
> escreveu:
>
>> So far all I have been able achieve is asking the user for permission
>> to send them notifications & if they accept all that happens is that
>> everytime they open the app they get a greetings notification, achieving
>> that was not complicated because it was straight forward, I placed the 
>> code
>> in my main.js script & it runs everytime the service worker gets 
>> registered.
>>
>> *CODE:*
>> Notification.requestPermission(result => {
>>   if (result === 'granted') {
>> showNotification('Welcome to My App™', 'Everything Services™')
>>   }
>> });
>>
>> function showNotification(title, message) {
>>   if ('Notification' in window) {
>> navigator.serviceWorker.ready.then(registration => {
>>   registration.showNotification(title, {
>> body: message,
>> tag: 'my-app',
>> icon:'/init/static/images/icon_192x192.png',
>> badge:'/init/static/images/icon_128x128.png',
>> vibrate: [200, 100, 200, 100, 200, 100]
>>   });
>> });
>>   }
>> }
>>
>>
>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>
>>>
>>> Has anyone been able to implement push notifications on their web2py
>>> apps?
>>>
>>> I need a working application with some examples on how to implement
>>> this for one of my applications.
>>>
>>> I've been looking at the "web-push-book (
>>> https://web-push-book.gauntface.com/how-push-works/)" but I cant
>>> put it together in my head.
>>>
>>> What I wanna achieve is relatively basic, I have an applivcation
>>> that offers information on services & products sold in my area, so what 
>>> I
>>> want is to be able to send notifications everytime a new service or 
>>> product
>>> is registered.
>>>
>>> If anyone has any idea on how I can easily implement this please
>>> help me.
>>>
>>> Regards;
>>>
>>> Mostwanted
>>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to web2py+un...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>> 

Re: [web2py] Re: Push Notifications

2020-11-20 Thread mostwanted
Gratitude

On Friday, November 20, 2020 at 10:33:10 AM UTC+2 Ramos wrote:

> create a module inside web2py
> API_Pusher.py
>
> import pusher
>
> def pusher_client():
> return pusher.Pusher(
>   app_id='yourid',
>   key='yourkey',
>   secret='yoursecret',
>   cluster='eu',
>   ssl=True
> )
>
>
> Then inside your controllers
>
> from API_Pusher import pusher_client
> ...
> pusher_client().trigger('fileit', 'plannerPesos',  {'message': 
> "PlaySound('ok')"})
>
> Em sex., 20 de nov. de 2020 às 07:41, mostwanted  
> escreveu:
>
>> Hey Ramos, I was able to successfully register the app on pusher.com. 
>> towards step 4 its says i should copy this code:
>> *CODE:*
>> curl -H "Content-Type: application/json" \
>>  -H "Authorization: Bearer 
>> 9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
>>  -X POST "
>> https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes;
>>  
>> \
>>  -d 
>> '{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello,
>>  
>> world!"}}}'
>>
>> to my console! Which console is this one? My desktop console? I'm hosted 
>> with pythonanywhere.com, can i use the Bash console in my dashboard?
>>
>> On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:
>>
>>> Thanks alot Ramos, think this will work, very little work needs to be 
>>> done here, I'll try it out.
>>>
>>> On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:
>>>
 Why reiventing the wheel ??? 
 https://pusher.com/

 I use it with web2py and works like a charm


 Em seg., 16 de nov. de 2020 às 08:44, mostwanted  
 escreveu:

> So far all I have been able achieve is asking the user for permission 
> to send them notifications & if they accept all that happens is that 
> everytime they open the app they get a greetings notification, achieving 
> that was not complicated because it was straight forward, I placed the 
> code 
> in my main.js script & it runs everytime the service worker gets 
> registered.
>
> *CODE:*
> Notification.requestPermission(result => {
>   if (result === 'granted') {
> showNotification('Welcome to My App™', 'Everything Services™')
>   }
> });
>
> function showNotification(title, message) {
>   if ('Notification' in window) {
> navigator.serviceWorker.ready.then(registration => {
>   registration.showNotification(title, {
> body: message,
> tag: 'my-app',
> icon:'/init/static/images/icon_192x192.png',
> badge:'/init/static/images/icon_128x128.png',
> vibrate: [200, 100, 200, 100, 200, 100]
>   });
> });
>   }
> }
>
>
> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>
>>
>> Has anyone been able to implement push notifications on their web2py 
>> apps? 
>>
>> I need a working application with some examples on how to implement 
>> this for one of my applications.
>>
>> I've been looking at the "web-push-book (
>> https://web-push-book.gauntface.com/how-push-works/)" but I cant put 
>> it together in my head.
>>
>> What I wanna achieve is relatively basic, I have an applivcation that 
>> offers information on services & products sold in my area, so what I 
>> want 
>> is to be able to send notifications everytime a new service or product 
>> is 
>> registered.
>>
>> If anyone has any idea on how I can easily implement this please help 
>> me.
>>
>> Regards;
>>
>> Mostwanted
>>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google 
> Groups "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to web2py+un...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>  
> 
> .
>
 -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe 

Re: [web2py] Re: Push Notifications

2020-11-20 Thread António Ramos
create a module inside web2py
API_Pusher.py

import pusher

def pusher_client():
return pusher.Pusher(
  app_id='yourid',
  key='yourkey',
  secret='yoursecret',
  cluster='eu',
  ssl=True
)


Then inside your controllers

from API_Pusher import pusher_client
...
pusher_client().trigger('fileit', 'plannerPesos',  {'message':
"PlaySound('ok')"})

Em sex., 20 de nov. de 2020 às 07:41, mostwanted 
escreveu:

> Hey Ramos, I was able to successfully register the app on pusher.com.
> towards step 4 its says i should copy this code:
> *CODE:*
> curl -H "Content-Type: application/json" \
>  -H "Authorization: Bearer
> 9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
>  -X POST "
> https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes;
> \
>  -d
> '{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello,
> world!"}}}'
>
> to my console! Which console is this one? My desktop console? I'm hosted
> with pythonanywhere.com, can i use the Bash console in my dashboard?
>
> On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:
>
>> Thanks alot Ramos, think this will work, very little work needs to be
>> done here, I'll try it out.
>>
>> On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:
>>
>>> Why reiventing the wheel ???
>>> https://pusher.com/
>>>
>>> I use it with web2py and works like a charm
>>>
>>>
>>> Em seg., 16 de nov. de 2020 às 08:44, mostwanted 
>>> escreveu:
>>>
 So far all I have been able achieve is asking the user for permission
 to send them notifications & if they accept all that happens is that
 everytime they open the app they get a greetings notification, achieving
 that was not complicated because it was straight forward, I placed the code
 in my main.js script & it runs everytime the service worker gets 
 registered.

 *CODE:*
 Notification.requestPermission(result => {
   if (result === 'granted') {
 showNotification('Welcome to My App™', 'Everything Services™')
   }
 });

 function showNotification(title, message) {
   if ('Notification' in window) {
 navigator.serviceWorker.ready.then(registration => {
   registration.showNotification(title, {
 body: message,
 tag: 'my-app',
 icon:'/init/static/images/icon_192x192.png',
 badge:'/init/static/images/icon_128x128.png',
 vibrate: [200, 100, 200, 100, 200, 100]
   });
 });
   }
 }


 On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:

>
> Has anyone been able to implement push notifications on their web2py
> apps?
>
> I need a working application with some examples on how to implement
> this for one of my applications.
>
> I've been looking at the "web-push-book (
> https://web-push-book.gauntface.com/how-push-works/)" but I cant put
> it together in my head.
>
> What I wanna achieve is relatively basic, I have an applivcation that
> offers information on services & products sold in my area, so what I want
> is to be able to send notifications everytime a new service or product is
> registered.
>
> If anyone has any idea on how I can easily implement this please help
> me.
>
> Regards;
>
> Mostwanted
>
 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+un...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
 
 .

>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/ca28be9e-6720-4993-9f68-1a42cf57a2c1n%40googlegroups.com
> 

Re: [web2py] Re: Push Notifications

2020-11-19 Thread mostwanted
Hey Ramos, I was able to successfully register the app on pusher.com. 
towards step 4 its says i should copy this code:
*CODE:*
curl -H "Content-Type: application/json" \
 -H "Authorization: Bearer 
9C9232906DFC6C8F8115926CC30D637945EB75F60467DA77977C399C4235E61C" \
 -X POST 
"https://733e2240-aca0-4a12-a5a9-c3b1422b9063.pushnotifications.pusher.com/publish_api/v1/instances/733e2240-aca0-4a12-a5a9-c3b1422b9063/publishes;
 
\
 -d 
'{"interests":["hello"],"web":{"notification":{"title":"Hello","body":"Hello, 
world!"}}}'

to my console! Which console is this one? My desktop console? I'm hosted 
with pythonanywhere.com, can i use the Bash console in my dashboard?

On Tuesday, November 17, 2020 at 7:53:20 AM UTC+2 mostwanted wrote:

> Thanks alot Ramos, think this will work, very little work needs to be done 
> here, I'll try it out.
>
> On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:
>
>> Why reiventing the wheel ??? 
>> https://pusher.com/
>>
>> I use it with web2py and works like a charm
>>
>>
>> Em seg., 16 de nov. de 2020 às 08:44, mostwanted  
>> escreveu:
>>
>>> So far all I have been able achieve is asking the user for permission to 
>>> send them notifications & if they accept all that happens is that everytime 
>>> they open the app they get a greetings notification, achieving that was not 
>>> complicated because it was straight forward, I placed the code in my 
>>> main.js script & it runs everytime the service worker gets registered.
>>>
>>> *CODE:*
>>> Notification.requestPermission(result => {
>>>   if (result === 'granted') {
>>> showNotification('Welcome to My App™', 'Everything Services™')
>>>   }
>>> });
>>>
>>> function showNotification(title, message) {
>>>   if ('Notification' in window) {
>>> navigator.serviceWorker.ready.then(registration => {
>>>   registration.showNotification(title, {
>>> body: message,
>>> tag: 'my-app',
>>> icon:'/init/static/images/icon_192x192.png',
>>> badge:'/init/static/images/icon_128x128.png',
>>> vibrate: [200, 100, 200, 100, 200, 100]
>>>   });
>>> });
>>>   }
>>> }
>>>
>>>
>>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>>

 Has anyone been able to implement push notifications on their web2py 
 apps? 

 I need a working application with some examples on how to implement 
 this for one of my applications.

 I've been looking at the "web-push-book (
 https://web-push-book.gauntface.com/how-push-works/)" but I cant put 
 it together in my head.

 What I wanna achieve is relatively basic, I have an applivcation that 
 offers information on services & products sold in my area, so what I want 
 is to be able to send notifications everytime a new service or product is 
 registered.

 If anyone has any idea on how I can easily implement this please help 
 me.

 Regards;

 Mostwanted

>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ca28be9e-6720-4993-9f68-1a42cf57a2c1n%40googlegroups.com.


Re: [web2py] Re: Push Notifications

2020-11-16 Thread mostwanted
Thanks alot Ramos, think this will work, very little work needs to be done 
here, I'll try it out.

On Tuesday, November 17, 2020 at 1:06:10 AM UTC+2 Ramos wrote:

> Why reiventing the wheel ??? 
> https://pusher.com/
>
> I use it with web2py and works like a charm
>
>
> Em seg., 16 de nov. de 2020 às 08:44, mostwanted  
> escreveu:
>
>> So far all I have been able achieve is asking the user for permission to 
>> send them notifications & if they accept all that happens is that everytime 
>> they open the app they get a greetings notification, achieving that was not 
>> complicated because it was straight forward, I placed the code in my 
>> main.js script & it runs everytime the service worker gets registered.
>>
>> *CODE:*
>> Notification.requestPermission(result => {
>>   if (result === 'granted') {
>> showNotification('Welcome to My App™', 'Everything Services™')
>>   }
>> });
>>
>> function showNotification(title, message) {
>>   if ('Notification' in window) {
>> navigator.serviceWorker.ready.then(registration => {
>>   registration.showNotification(title, {
>> body: message,
>> tag: 'my-app',
>> icon:'/init/static/images/icon_192x192.png',
>> badge:'/init/static/images/icon_128x128.png',
>> vibrate: [200, 100, 200, 100, 200, 100]
>>   });
>> });
>>   }
>> }
>>
>>
>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>
>>>
>>> Has anyone been able to implement push notifications on their web2py 
>>> apps? 
>>>
>>> I need a working application with some examples on how to implement this 
>>> for one of my applications.
>>>
>>> I've been looking at the "web-push-book (
>>> https://web-push-book.gauntface.com/how-push-works/)" but I cant put it 
>>> together in my head.
>>>
>>> What I wanna achieve is relatively basic, I have an applivcation that 
>>> offers information on services & products sold in my area, so what I want 
>>> is to be able to send notifications everytime a new service or product is 
>>> registered.
>>>
>>> If anyone has any idea on how I can easily implement this please help me.
>>>
>>> Regards;
>>>
>>> Mostwanted
>>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/df9d944b-aecc-493d-91a9-b0802987d752n%40googlegroups.com.


Re: [web2py] Re: Push Notifications

2020-11-16 Thread AGRogers
Thanks for the tip Antonio. The free version could work well for me. I dont
mind reinventing the wheel - I just dont like fixing it when it breaks :)

___
*www.TenOutOfTen.org* 
rogers...@gmail.com
(+95) 09 250018669 (Myanmar)



On Tue, 17 Nov 2020 at 09:05, António Ramos  wrote:

> Why reiventing the wheel ???
> https://pusher.com/
>
> I use it with web2py and works like a charm
>
>
> Em seg., 16 de nov. de 2020 às 08:44, mostwanted 
> escreveu:
>
>> So far all I have been able achieve is asking the user for permission to
>> send them notifications & if they accept all that happens is that everytime
>> they open the app they get a greetings notification, achieving that was not
>> complicated because it was straight forward, I placed the code in my
>> main.js script & it runs everytime the service worker gets registered.
>>
>> *CODE:*
>> Notification.requestPermission(result => {
>>   if (result === 'granted') {
>> showNotification('Welcome to My App™', 'Everything Services™')
>>   }
>> });
>>
>> function showNotification(title, message) {
>>   if ('Notification' in window) {
>> navigator.serviceWorker.ready.then(registration => {
>>   registration.showNotification(title, {
>> body: message,
>> tag: 'my-app',
>> icon:'/init/static/images/icon_192x192.png',
>> badge:'/init/static/images/icon_128x128.png',
>> vibrate: [200, 100, 200, 100, 200, 100]
>>   });
>> });
>>   }
>> }
>>
>>
>> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>>
>>>
>>> Has anyone been able to implement push notifications on their web2py
>>> apps?
>>>
>>> I need a working application with some examples on how to implement this
>>> for one of my applications.
>>>
>>> I've been looking at the "web-push-book (
>>> https://web-push-book.gauntface.com/how-push-works/)" but I cant put it
>>> together in my head.
>>>
>>> What I wanna achieve is relatively basic, I have an applivcation that
>>> offers information on services & products sold in my area, so what I want
>>> is to be able to send notifications everytime a new service or product is
>>> registered.
>>>
>>> If anyone has any idea on how I can easily implement this please help me.
>>>
>>> Regards;
>>>
>>> Mostwanted
>>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
>> 
>> .
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CAEM0BxPX9jKzoBFiVK093YXR912h6ZFb5pzPXU%3DyUkF33yi1hw%40mail.gmail.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CACWMBMPyL3L%2BS0YFwVG93GC6EnQ-wSwR_8eiypvk2JznEcsy9w%40mail.gmail.com.


Re: [web2py] Re: Push Notifications

2020-11-16 Thread António Ramos
Why reiventing the wheel ???
https://pusher.com/

I use it with web2py and works like a charm


Em seg., 16 de nov. de 2020 às 08:44, mostwanted 
escreveu:

> So far all I have been able achieve is asking the user for permission to
> send them notifications & if they accept all that happens is that everytime
> they open the app they get a greetings notification, achieving that was not
> complicated because it was straight forward, I placed the code in my
> main.js script & it runs everytime the service worker gets registered.
>
> *CODE:*
> Notification.requestPermission(result => {
>   if (result === 'granted') {
> showNotification('Welcome to My App™', 'Everything Services™')
>   }
> });
>
> function showNotification(title, message) {
>   if ('Notification' in window) {
> navigator.serviceWorker.ready.then(registration => {
>   registration.showNotification(title, {
> body: message,
> tag: 'my-app',
> icon:'/init/static/images/icon_192x192.png',
> badge:'/init/static/images/icon_128x128.png',
> vibrate: [200, 100, 200, 100, 200, 100]
>   });
> });
>   }
> }
>
>
> On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:
>
>>
>> Has anyone been able to implement push notifications on their web2py
>> apps?
>>
>> I need a working application with some examples on how to implement this
>> for one of my applications.
>>
>> I've been looking at the "web-push-book (
>> https://web-push-book.gauntface.com/how-push-works/)" but I cant put it
>> together in my head.
>>
>> What I wanna achieve is relatively basic, I have an applivcation that
>> offers information on services & products sold in my area, so what I want
>> is to be able to send notifications everytime a new service or product is
>> registered.
>>
>> If anyone has any idea on how I can easily implement this please help me.
>>
>> Regards;
>>
>> Mostwanted
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxPX9jKzoBFiVK093YXR912h6ZFb5pzPXU%3DyUkF33yi1hw%40mail.gmail.com.


[web2py] Re: Push Notifications

2020-11-16 Thread mostwanted
So far all I have been able achieve is asking the user for permission to 
send them notifications & if they accept all that happens is that everytime 
they open the app they get a greetings notification, achieving that was not 
complicated because it was straight forward, I placed the code in my 
main.js script & it runs everytime the service worker gets registered.

*CODE:*
Notification.requestPermission(result => {
  if (result === 'granted') {
showNotification('Welcome to My App™', 'Everything Services™')
  }
});

function showNotification(title, message) {
  if ('Notification' in window) {
navigator.serviceWorker.ready.then(registration => {
  registration.showNotification(title, {
body: message,
tag: 'my-app',
icon:'/init/static/images/icon_192x192.png',
badge:'/init/static/images/icon_128x128.png',
vibrate: [200, 100, 200, 100, 200, 100]
  });
});
  }
}


On Monday, November 16, 2020 at 10:31:10 AM UTC+2 mostwanted wrote:

>
> Has anyone been able to implement push notifications on their web2py apps? 
>
> I need a working application with some examples on how to implement this 
> for one of my applications.
>
> I've been looking at the "web-push-book (
> https://web-push-book.gauntface.com/how-push-works/)" but I cant put it 
> together in my head.
>
> What I wanna achieve is relatively basic, I have an applivcation that 
> offers information on services & products sold in my area, so what I want 
> is to be able to send notifications everytime a new service or product is 
> registered.
>
> If anyone has any idea on how I can easily implement this please help me.
>
> Regards;
>
> Mostwanted
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/01da1065-f7d3-4394-9014-a424639bef03n%40googlegroups.com.


[web2py] Re: Push Notifications

2016-11-08 Thread Dave S


On Tuesday, November 8, 2016 at 4:45:48 AM UTC-8, Michael Beller wrote:
>
> I've been thinking about trying https://pusher.com/
>
>
They use servers running on an Amazon cluster?

/dps

 

>
> On Wednesday, November 2, 2016 at 6:32:54 PM UTC-4, David wrote:
>>
>> Hello, 
>>
>> My website allows users to send messages to one another; however, the 
>> only way to see their new messages is to refresh the page. Is there any way 
>> to notify the user via any method? 
>>
>> Thanks for your time
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-08 Thread Dave S


On Wednesday, November 2, 2016 at 7:37:52 PM UTC-7, Anthony wrote:
>
> [...] You can also use various realtime messaging services (e.g., Fanout 
> ), or something like Pushpin  
> (an open source proxy server used by Fanout), which is probably a bit more 
> robust and full-featured than websocket_messaging.py.
>
>
Pushpin looks pretty easy to set up.  For the client side, they seem to 
recommend the Pollymer ajax library.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-08 Thread Michael Beller
I've been thinking about trying https://pusher.com/


On Wednesday, November 2, 2016 at 6:32:54 PM UTC-4, David wrote:
>
> Hello, 
>
> My website allows users to send messages to one another; however, the only 
> way to see their new messages is to refresh the page. Is there any way to 
> notify the user via any method? 
>
> Thanks for your time
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-03 Thread David
I read your link, Anthony. Based off of your link, a few other pages linked 
from your link, and a couple of Google searches I can see that sqlite is small 
time(unless you tweak it) and I'll definitely need to switch my db eventually.

Thanks for both of you guys time.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-03 Thread Anthony
On Thursday, November 3, 2016 at 3:51:16 PM UTC-4, Dave S wrote:
>
>
> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
>>> when it was time to replace the content.  A couple of the examples 
>>> calculate Pi, and paste the results into the main page.
>>>
>>
>> This approach is "short polling" (i.e., polling the server with quick 
>> requests at some interval to check for updates). Note, there is no 
>> particular reason this must be done with a web worker -- you can simply do 
>> it from the main web page, as it has been done since long before web 
>> workers existed. 
>>
>
> The idea I was applying was keeping the main page quiet, although Google 
> News has used refresh interval to update the entire main page.
> Web workers give you a thicker curtain to draw over the checkers, than 
> does a LOAD/jquery/ajax in a timer loop on the main page.
>

Understood. Just wanted to make it clear that the short-polling approach 
does not *require* the added complication of web workers.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-03 Thread Anthony
On Thursday, November 3, 2016 at 3:48:29 PM UTC-4, David wrote:
>
> Thanks for such a thorough response, Anthony!
>
> Long polling seems to be the way to go for my website. I've been reading 
> up on the tornado web socket  all day. 
>
> I'm nearing 100 users on my website and i believe that speed will be a 
> problem eventually. I'm deployed to python anywhere like you suggested; 
> however, i am using sqlite still. As of now, everything is working and i've 
> received no complaints on performance. Will there be a problem with long 
> polling while using sqlite?
>

Use of long-polling/websockets will not affect the database. You just have 
to worry about how many reads and writes you are doing. You might get away 
with SQLite for quite a while -- see https://sqlite.org/whentouse.html.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-03 Thread Dave S


On Wednesday, November 2, 2016 at 7:37:52 PM UTC-7, Anthony wrote:
>
> On Wednesday, November 2, 2016 at 7:52:05 PM UTC-4, Dave S wrote:
>>
>> There are 2 mechanism in HTML5, I believe, but I'm only going to point 
>> you at one for the moment:  Web Workers.
>> > http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
>> >
>> > http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
>> >
>> > http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
>> >
>>
>> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
>> when it was time to replace the content.  A couple of the examples 
>> calculate Pi, and paste the results into the main page.
>>
>
> This approach is "short polling" (i.e., polling the server with quick 
> requests at some interval to check for updates). Note, there is no 
> particular reason this must be done with a web worker -- you can simply do 
> it from the main web page, as it has been done since long before web 
> workers existed. 
>

The idea I was applying was keeping the main page quiet, although Google 
News has used refresh interval to update the entire main page.
Web workers give you a thicker curtain to draw over the checkers, than does 
a LOAD/jquery/ajax in a timer loop on the main page.
 

> The idea is simply to keep making Ajax requests at regular intervals 
> (e.g., every second). This approach might be fine, though depending on how 
> many users are connected and how frequently they are checking, the server 
> could get overwhelmed with requests. To reduce the load, you can decrease 
> the request frequency, but then you increase the average latency between 
> when a message is sent and when the recipient receives it.
>  
>
>> There is also web sockets in HTML5.
>> > http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
>> >
>> Gluon/contrib has websocket_messaging.py.
>>
>
> To handle the shortcomings of "short polling", you can instead use 
> websockets (or long-polling, which maintains a long-held HTTP connection 
> with the server until a new message is received). However, you need a web 
> server and application that can handle many long-held open connections. To 
> address this need, web2py includes websocket_messaging.py, as noted above 
> -- it makes use of the Tornado web server to handle the websocket 
> connections. You can also use various realtime messaging services (e.g., 
> Fanout ), or something like Pushpin 
>  (an open source proxy server used by Fanout), which 
> is probably a bit more robust and full-featured than websocket_messaging.py.
>
> Anthony
>

Thanks for the additional pointers.
 

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-03 Thread Jaimee S
Thanks for such a thorough response, Anthony!

Long polling seems to be the way to go for my website. I've been reading up 
on the tornado web socket  all day. 

I'm nearing 100 users on my website and i believe that speed will be a 
problem eventually. I'm deployed to python anywhere like you suggested; 
however, i am using sqlite still. As of now, everything is working and i've 
received no complaints on performance. Will there be a problem with long 
polling while using sqlite?

On Wednesday, November 2, 2016 at 9:37:52 PM UTC-5, Anthony wrote:
>
> On Wednesday, November 2, 2016 at 7:52:05 PM UTC-4, Dave S wrote:
>>
>> There are 2 mechanism in HTML5, I believe, but I'm only going to point 
>> you at one for the moment:  Web Workers.
>> > http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
>> >
>> > http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
>> >
>> > http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
>> >
>>
>> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
>> when it was time to replace the content.  A couple of the examples 
>> calculate Pi, and paste the results into the main page.
>>
>
> This approach is "short polling" (i.e., polling the server with quick 
> requests at some interval to check for updates). Note, there is no 
> particular reason this must be done with a web worker -- you can simply do 
> it from the main web page, as it has been done since long before web 
> workers existed. The idea is simply to keep making Ajax requests at regular 
> intervals (e.g., every second). This approach might be fine, though 
> depending on how many users are connected and how frequently they are 
> checking, the server could get overwhelmed with requests. To reduce the 
> load, you can decrease the request frequency, but then you increase the 
> average latency between when a message is sent and when the recipient 
> receives it.
>  
>
>> There is also web sockets in HTML5.
>> > http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
>> >
>> Gluon/contrib has websocket_messaging.py.
>>
>
> To handle the shortcomings of "short polling", you can instead use 
> websockets (or long-polling, which maintains a long-held HTTP connection 
> with the server until a new message is received). However, you need a web 
> server and application that can handle many long-held open connections. To 
> address this need, web2py includes websocket_messaging.py, as noted above 
> -- it makes use of the Tornado web server to handle the websocket 
> connections. You can also use various realtime messaging services (e.g., 
> Fanout ), or something like Pushpin 
>  (an open source proxy server used by Fanout), which 
> is probably a bit more robust and full-featured than websocket_messaging.py.
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-02 Thread Anthony
On Wednesday, November 2, 2016 at 7:52:05 PM UTC-4, Dave S wrote:
>
> There are 2 mechanism in HTML5, I believe, but I'm only going to point you 
> at one for the moment:  Web Workers.
>  http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
> >
>  http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
> >
>  http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
> >
>
> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
> when it was time to replace the content.  A couple of the examples 
> calculate Pi, and paste the results into the main page.
>

This approach is "short polling" (i.e., polling the server with quick 
requests at some interval to check for updates). Note, there is no 
particular reason this must be done with a web worker -- you can simply do 
it from the main web page, as it has been done since long before web 
workers existed. The idea is simply to keep making Ajax requests at regular 
intervals (e.g., every second). This approach might be fine, though 
depending on how many users are connected and how frequently they are 
checking, the server could get overwhelmed with requests. To reduce the 
load, you can decrease the request frequency, but then you increase the 
average latency between when a message is sent and when the recipient 
receives it.
 

> There is also web sockets in HTML5.
>  http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
> >
> Gluon/contrib has websocket_messaging.py.
>

To handle the shortcomings of "short polling", you can instead use 
websockets (or long-polling, which maintains a long-held HTTP connection 
with the server until a new message is received). However, you need a web 
server and application that can handle many long-held open connections. To 
address this need, web2py includes websocket_messaging.py, as noted above 
-- it makes use of the Tornado web server to handle the websocket 
connections. You can also use various realtime messaging services (e.g., 
Fanout ), or something like Pushpin 
 (an open source proxy server used by Fanout), which 
is probably a bit more robust and full-featured than websocket_messaging.py.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-02 Thread Jaimee S
Thanks for the speedy reply! I've looked over the links you sent. the first 
two didn't work for me on my browser. I'm on a a mac and used the default 
browser. 

Will having a web socket open 24/7 slow down my website? My knowledge of 
web sockets is limited at the moment

On Wednesday, November 2, 2016 at 6:52:05 PM UTC-5, Dave S wrote:
>
>
>
> On Wednesday, November 2, 2016 at 3:32:54 PM UTC-7, Jaimee S wrote:
>>
>> Hello, 
>>
>> My website allows users to send messages to one another; however, the 
>> only way to see their new messages is to refresh the page. Is there any way 
>> to notify the user via any method? 
>>
>> Thanks for your time
>>
>
>
> There are 2 mechanism in HTML5, I believe, but I'm only going to point you 
> at one for the moment:  Web Workers.
>  http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html
> >
>  http://www.htmlgoodies.com/HTML5/client/introduction-to-html5-web-workers-the-javascript-multi-threading-approach.html
> >
>  http://www.htmlgoodies.com/html5/other/html5-tech-shared-web-workers-help-spread-the-news.html
> >
>
> With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
> when it was time to replace the content.  A couple of the examples 
> calculate Pi, and paste the results into the main page.
>
> There is also web sockets in HTML5.
>  http://www.htmlgoodies.com/html5/tutorials/making-html5-websockets-work.html
> >
> Gluon/contrib has websocket_messaging.py.
>
> I thought I remembered an HTML5 server push mechanisms for notifications, 
> but if it's there I'm not looking in the right place.
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Push Notifications

2016-11-02 Thread Dave S


On Wednesday, November 2, 2016 at 3:32:54 PM UTC-7, Jaimee S wrote:
>
> Hello, 
>
> My website allows users to send messages to one another; however, the only 
> way to see their new messages is to refresh the page. Is there any way to 
> notify the user via any method? 
>
> Thanks for your time
>


There are 2 mechanism in HTML5, I believe, but I'm only going to point you 
at one for the moment:  Web Workers.
http://www.htmlgoodies.com/html5/javascript/working-with-web-workers-in-html5-powered-web-pages.html>



With this mechanism, you'd spawn a web worker  to do jquery/ajax to check 
when it was time to replace the content.  A couple of the examples 
calculate Pi, and paste the results into the main page.

There is also web sockets in HTML5.

Gluon/contrib has websocket_messaging.py.

I thought I remembered an HTML5 server push mechanisms for notifications, 
but if it's there I'm not looking in the right place.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.