You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks a lot for the library! I am trying to use the subscriber example and being new to websub I am a bit lost on what the different urls or concepts refer to. Taking as example the towardsdatascience blog on Medium I have several urls:
Could you clarify which variables in client.py correspond to the above URLs?
PD: can I assume that anytime a new article is published on that blog the on_topic_change endpoint will run? Also do I need to do something to stay subscribed forever or do I need to run a cron job to renew?
The text was updated successfully, but these errors were encountered:
You can indeed take client_example.py as a starting point. In your case, app.config['SERVER_NAME'] = '967560ffa8a4.ngrok.io'. Yes, you'll get notified of changes using on_topic_change. I'd also monitor on_success and on_error. The default example uses a discovery mechanism to find the hub url and topic url, but it appears that won't work with towarddatascience.com, as it doesn't include the required metadata in its html. So you need to specify these manually, e.g.:
# actual subscription - only needs to run once.subscriber.subscribe(hub_url='https://medium.superfeedr.com', topic_url='https://towardsdatascience.com/')
I'm not sure about the topic url either, as discovery won't work here. Medium should be able to tell you what it is or should have documented that somewhere. The blog url is a reasonable guess though.
Yes, you need to run the following function every once in a while. If you don't, the hub will drop your subscription after a while:
defcleanup_and_renew_all():
subscriber.cleanup()
# 100 days, to make sure every single subscription is renewedsubscriber.renew_close_to_expiration(24*60*60*100)
You can for example do that using celery, but your cron job approach could work as well I think.
Hi, thanks a lot for the library! I am trying to use the subscriber example and being new to websub I am a bit lost on what the different urls or concepts refer to. Taking as example the towardsdatascience blog on Medium I have several urls:
Mediums WebSub endpoint: https://medium.superfeedr.com
Callback url (where client.py is running): http://967560ffa8a4.ngrok.io
Blog url (is this the topic?): https://towardsdatascience.com/
Could you clarify which variables in
client.py
correspond to the above URLs?PD: can I assume that anytime a new article is published on that blog the
on_topic_change
endpoint will run? Also do I need to do something to stay subscribed forever or do I need to run a cron job to renew?The text was updated successfully, but these errors were encountered: