Xml2js problem registering

I'm not having any luck installing xml2js
Can you help?
Here is some info :-1:
This is the flow address

BBC Weather To Twitter
https://flows.nodered.org/flow/0d98ac57a6ebf724def9

It requires xml2js, I've installed it with npm, but as you can see below there is a problem??

15 Jan 07:07:52 - [info] Waiting for missing types to be registered:
15 Jan 07:07:52 - [info] - xml2js

pi@raspberrypi:~/.node-red $ npm list
node-red-project@0.0.1 /home/pi/.node-red
├─┬ node-red-dashboard@2.13.0

further down
│ │ └── ms@2.0.0 deduped
│ └── isarray@2.0.1 deduped
└─┬ xml2js@0.4.19
├── sax@1.2.4
└── xmlbuilder@9.0.7

Please help - thanks
Jay

Solving that isn't unfortunately going to give you what you want, as the BBC have changed their feed structure.

The URL in that data now just gives

<?xml version="1.0" encoding="UTF-8"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">  <channel>    <atom:link href="http://open.live.bbc.co.uk/weather/feeds/en/NE16/3dayforecast.rss" rel="self" type="application/rss+xml" />    <title>BBC Weather - Forecast for  NE16, United Kingdom</title>    <link>http://www.bbc.co.uk/weather/ne16</link>    <description>3-day forecast for NE16 from BBC Weather, including weather, temperature and wind information</description>    <language>en</language>    <copyright>Copyright: (C) British Broadcasting Corporation, see http://www.bbc.co.uk/terms/additional_rss.shtml for more details</copyright>    <pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate>  </channel></rss>

Rather than the 3 day forecast.

The new structure is described here https://www.bbc.co.uk/weather/about/17543675 including the Terms of Use.

You can use the standard pre-installed xml node to do the work of the missing xml2js component.
Attach a debug and then using the tooltips described here https://nodered.org/docs/user-guide/messages

You should be able to find and copy the paths to the pieces of the messages you want.

1 Like

@ukjay in addition to the response from @ukmoose, which is absolutely correct, I thought I'd add a comment on why the xml2js node isn't appearing.

You have tried to install the xml2js npm module. This is the raw node.js module and not a Node-RED node module. I started this reply expecting to point you, for educational purposes, at the appropriate node-red node module to install. But it appears that whatever module provided that node no longer exists!

Given the changes to the BBC website and the lack of xml2js node to install, that example flow isn't very useful anymore. I've removed it from the flow library.

1 Like

Our built in XML node contains the xml2js npm library.

1 Like

Thanks everyone for the fast & helpful responses!
After I posted, I looked at the package-lock.json file
I then did npm i sax & also xmlbuilder & I'm sure they installed ok, but the package file now says it requires sax as a dependency again??
Anyway, not to worry all this is helping me understand node-red a bit more, all I want is a good example of a tweet node that works ....

Jay

the built in Twitter node should work...

1 Like

Yes it has thanks, I even tweeted something, so that's a start

Jay

Tweeting OK

Jay
(would be better if the data was for Stoke-on-Trent though)

You might want to read the terms of use…

1 Like