0

I have a dynamic XML feed and I want to get notified by email (or Slack) every time a new item has been added to the feed. I really don't know where to start and which programming language would be best to achieve that. I know a little PHP but not very good. Any guidance is highly appreciated to get started!

I use Postman to see the data but I couldn't find any option to subscribe to updates from a URL. I also tried zapier but it said the the XML was not valid. (Here's the feed: https://www.semtrack.de/e?i=251918536fedf0b20164555a698a7a0afd0c6dfd).

ferdman
  • 46
  • 6
  • If you want to program a solution yourself (and you totally should) I'd suggest learning how to query XML. XPath is the general 'language'. You can use a tool like `xmlstarlet`, for querying and manipulating XML (using XPath). You may use bash or Python for automating. All this will take steep learning curves. Alternatively, you could use a service like feedburner.co (if I remember correctly). They specifically supply the service you seek. At one point, I even subscribed to a paid plan for a short period of time. Yet, learning XML basics will help you most in the long run. – RvT Nov 09 '22 at 00:38
  • Thanks @RvT for your explanation, that helps me a lot getting started. – ferdman Nov 09 '22 at 11:47
  • I should also warn you that some services may cut you off if you retrieve their feed on a regular basis (based on personal experience...). Also, I found out that MS Outlook allows you to subscribe to RSS feeds. That was one of the reasons I ended my feedburner subscription. Being stuck in a work environment with no other options, this was my way to still get notified of GitLab updates. A bit crude, but it works. If I find the time, I may add an answer with some examples that you could use as a starting point for learning languages and tools. – RvT Nov 09 '22 at 14:55

1 Answers1

1

Write a cron job that executes periodically a python script: Execute Python script via crontab

The script should compare the current XML with the last XML with a diff tool e.g.: https://pypi.org/project/xmldiff/

If there is a difference, send an email via python: How to send an email with Python?

chachoo
  • 211
  • 3
  • 10