Page 4 of 9

Re: Twitter RSS Feeds

Posted: 15 Jun 2013, 23:34
by disillusioned
I'm almost speechless with gratitude!

In less than 48 hours, I've installed tt-rss on my hosting provider, migrated my feeds from G***** Reader, installed some useful plugins, tried out some great themes, begun testing various mobile interfaces, received some great guidance by reading the forum, and now, implemented this fantastic fix for my various broken Twitter feeds.

Thanks to jdelamater99, Fox, and everyone who's worked on tt-rss, created plugins or themes, or shared their expertise in this forum.

Re: Twitter RSS Feeds

Posted: 16 Jun 2013, 03:00
by lem0na
Hi all,

I have created a little modified version that supports search too. If someone finds it usefull feel free to use it.
Source: http://pastebin.com/3AFvuEAx

P.S.
I have not written any PHP code over 8 years so probably it is not the best one

Re: Twitter RSS Feeds

Posted: 16 Jun 2013, 10:15
by disillusioned
lem0na wrote:Hi all,

I have created a little modified version that supports search too. If someone finds it usefull feel free to use it.
Source: http://pastebin.com/3AFvuEAx

P.S.
I have not written any PHP code over 8 years so probably it is not the best one


Wow! I spent some time this evening trying to figure out how to modify the original script to do a search, gave up, and was about to ask for help when you posted this. Thank you so much!

Re: Twitter RSS Feeds

Posted: 16 Jun 2013, 10:47
by disillusioned
Would you please tell me what I should replace your URL with in line 152?

Code: Select all

print('<link type="application/atom+xml" rel="self" href="http://lem0na.net/twitrss.php" />' .PHP_EOL);

Thanks again.

Re: Twitter RSS Feeds

Posted: 16 Jun 2013, 13:25
by lem0na
Hi disillusioned,

I think you can safely skip this line, or change the url with the url of your script. I do not think it matters.

b.r.
lem0na

Re: Twitter RSS Feeds

Posted: 16 Jun 2013, 18:04
by zeiram
Hello

Thanks a lot for this script, it makes my life easier. :-)

I follow a twitter user (thetoolpage) and when I converted its feed with this script (using lem0na's version), the resulting feed did not validate (Tiny Tiny RSS complained about not being able to parse the document). The culprit was an ampersand character ('&') in the tweets.

And as it could happen quite often, here's the fix for that. Whenever you see:

Code: Select all

$item['text']
replace it with:

Code: Select all

htmlspecialchars($item['text'], ENT_NOQUOTES | ENT_XML1)


Then, I set out to make the feed pass validation, by adding this before the first call to print:

Code: Select all

header('Content-type: application/atom+xml; charset=UTF-8');


And I have a question (which makes the feed not pass validation yet): why are you outputting HTML code in the <content> tag? I don't see the use of those body and empty paragraphs tag...

Regards,

zeiram

Re: Twitter RSS Feeds

Posted: 16 Jun 2013, 20:02
by lem0na
Hi all,

I found another issue: result after calling processString returns corrupted result that prevents importing the feeds.
So far i observed that if the tweet text ends with something line http://t.co/gsFD... the generated url contains invalid charactes that prevents feeds import.
After I commented this function call the feeds are imported successfuly but as raw text

b.r.
lem0na

Re: Twitter RSS Feeds

Posted: 17 Jun 2013, 16:47
by jdelamater99
thats the function that searches for http(s) links and wraps them in <a> tags. you'll want to study up on you regular expressions if you want to try editing that.

Re: Twitter RSS Feeds

Posted: 17 Jun 2013, 17:22
by reibuehl
Hi all,

Is it possible with this script to "resolve" shortened URLs and embed pictures if the link points to a picture in a twitter feed?

BR
Reiner.

Re: Twitter RSS Feeds

Posted: 18 Jun 2013, 21:25
by jdelamater99
I'll look into this when I get a chance.

Re: Twitter RSS Feeds

Posted: 18 Jun 2013, 23:13
by sleeper_service
jdelamater99 wrote:I'll look into this when I get a chance.
yes please!

Re: Twitter RSS Feeds

Posted: 19 Jun 2013, 00:24
by psycik
Would using this method allow the reading of a users (me obviously) private twitter lists?

I have a bunch of companies in a list, twitter is useless as an announcement/news repository as posts don't wait like post to RSS do (whoever suggested twitter as a google reader replacement is a moron imo).

I'm looking for something that could take this twitter list and covert it to rss. I've played with TTR but not extensively (lack of windows client is a partial reason)

Re: Twitter RSS Feeds

Posted: 19 Jun 2013, 00:59
by sleeper_service
psycik wrote:Would using this method allow the reading of a users (me obviously) private twitter lists?

I have a bunch of companies in a list, twitter is useless as an announcement/news repository as posts don't wait like post to RSS do (whoever suggested twitter as a google reader replacement is a moron imo).

I'm looking for something that could take this twitter list and covert it to rss. I've played with TTR but not extensively (lack of windows client is a partial reason)


I'm really not sure what it is you think you're asking for, but I think that the answer is 'yes'.

Re: Twitter RSS Feeds

Posted: 19 Jun 2013, 01:56
by psycik
Private Twitter lists to RSS (in a nutshell)

Re: Twitter RSS Feeds

Posted: 19 Jun 2013, 02:32
by sleeper_service
psycik wrote:Private Twitter lists to RSS (in a nutshell)
if it can be pulled out via the twitter api, then it can be stuffed into rss.

or, you could just subscribe to all the twitter feeds you want via rss.