I'm having trouble saving my feeds with the API and cURL.

I’m having trouble saving my feeds with the API and cURL. I start with:

curl -d “username=XXX&password=XXX” --cookie-jar cookies.txt -i -X POST https://www.newsblur.com/api/login

Which authenticates me and sets a cookie in cookies.txt. Next, I say:

curl -cookie cookies.txt https://www.newsblur.com/import/opml_…

Which (I believe) carries on the session using the cookie and retrieves the OMPL XML. The response I receive is valid OMPL, but appears to be some default/boilerplate feed list – in other words, it’s not mine.

Any idea what I’m doing wrong?


1 Like

Check cookies.txt. It should have a ‘newsblur_sessionid’ cookie, because that’s the only cookie that matters.

It does indeed have that cookie. Full contents of that file:

Netscape HTTP Cookie File


This file was generated by libcurl! Edit at your own risk.

#HttpOnly_.newsblur.com TRUE / FALSE 1437964641 newsblur_sessionid xyox5au2llh4l9g12bhz366l471ssz8j

The second curl command still returns the sample OPML.

Well, if you’re passing that cookie, then NewsBlur should consider you authenticated. Try inspecting your web requests and seeing the cookies being sent. Just steal that cookie and see if it makes any difference.