Twitter RSS Feeds

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
disillusioned
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 15 Jun 2013, 23:19

Re: Twitter RSS Feeds

Postby disillusioned » 15 Jun 2013, 23:34

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.

lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Twitter RSS Feeds

Postby lem0na » 16 Jun 2013, 03:00

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

disillusioned
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 15 Jun 2013, 23:19

Re: Twitter RSS Feeds

Postby disillusioned » 16 Jun 2013, 10:15

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!

disillusioned
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 15 Jun 2013, 23:19

Re: Twitter RSS Feeds

Postby disillusioned » 16 Jun 2013, 10:47

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.

lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Twitter RSS Feeds

Postby lem0na » 16 Jun 2013, 13:25

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

zeiram
Bear Rating Trainee
Bear Rating Trainee
Posts: 12
Joined: 29 Apr 2013, 17:04

Re: Twitter RSS Feeds

Postby zeiram » 16 Jun 2013, 18:04

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

lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Twitter RSS Feeds

Postby lem0na » 16 Jun 2013, 20:02

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

jdelamater99
Bear Rating Master
Bear Rating Master
Posts: 109
Joined: 11 Apr 2013, 17:45

Re: Twitter RSS Feeds

Postby jdelamater99 » 17 Jun 2013, 16:47

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.

reibuehl
Bear Rating Trainee
Bear Rating Trainee
Posts: 25
Joined: 17 May 2013, 19:37

Re: Twitter RSS Feeds

Postby reibuehl » 17 Jun 2013, 17:22

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.

jdelamater99
Bear Rating Master
Bear Rating Master
Posts: 109
Joined: 11 Apr 2013, 17:45

Re: Twitter RSS Feeds

Postby jdelamater99 » 18 Jun 2013, 21:25

I'll look into this when I get a chance.

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: Twitter RSS Feeds

Postby sleeper_service » 18 Jun 2013, 23:13

jdelamater99 wrote:I'll look into this when I get a chance.
yes please!

psycik
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 19 Jun 2013, 00:20

Re: Twitter RSS Feeds

Postby psycik » 19 Jun 2013, 00:24

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)

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: Twitter RSS Feeds

Postby sleeper_service » 19 Jun 2013, 00:59

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'.

psycik
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 19 Jun 2013, 00:20

Re: Twitter RSS Feeds

Postby psycik » 19 Jun 2013, 01:56

Private Twitter lists to RSS (in a nutshell)

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: Twitter RSS Feeds

Postby sleeper_service » 19 Jun 2013, 02:32

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.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 6 guests