Plugin XML start tag cleaner

Post plugins and custom CSS snippets here
guylabs
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 27 Sep 2013, 17:29
Contact:

Plugin XML start tag cleaner

Postby guylabs » 27 Sep 2013, 17:33

Hi,

I created a small plugin which removes everything before the '<xml' start tag. I had a feed which sends some special characters before the xml start tag and ttrss couldn't parse it, so I created this 'one liner' plugin. Maybe it's useful for one of you. Feedback and questions are always welcome.

https://github.com/guylabs/ttrss-xml-start-tag-cleaner

Cheers,

Guy

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: Plugin XML start tag cleaner

Postby feader » 27 Sep 2013, 19:10

guylabs wrote:I created a small plugin which removes everything before the '<xml' start tag. I had a feed which sends some special characters before the xml start tag and ttrss couldn't parse it

That is a bit odd because of this, could you post the feed URL or tell us what characters are before the '<xml'?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Plugin XML start tag cleaner

Postby fox » 28 Sep 2013, 14:12

Probably broken unicode bom or some shit, trim is not going to remove that.

guylabs
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 27 Sep 2013, 17:29
Contact:

Re: Plugin XML start tag cleaner

Postby guylabs » 30 Sep 2013, 10:05

I just saw two cryptic characters on the first line when I opened up the debug feed update in ttrss. Unfortunately the website now corrected the feed and I'm not able to send you the raw xml anymore. But trim didn't remove this and therefore I needed to remove everything before the '<xml' tag. It is quite a specific use case and I don't know if it's worth to add this to the main code.

hrk
Bear Rating Disaster
Bear Rating Disaster
Posts: 75
Joined: 24 Apr 2013, 12:39

Re: Plugin XML start tag cleaner

Postby hrk » 30 Sep 2013, 11:45

As fox pointed out, it's most likely a BOM issue.

Further info: http://www.rgagnon.com/javadetails/java ... h-bom.html


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 4 guests