Twitter RSS Feeds

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
Mies
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 19 Jun 2013, 19:36

Re: Twitter RSS Feeds

Postby Mies » 20 Jun 2013, 13:07

Hi All,

Thanks for the various commets and replies. Haven't managed to make it work, but I put some of them below anyway for reference should others be looking into this too.

sleeper_service wrote:
Mies wrote:Off course I have one question too. I am or now was sheelding my TT-RSS install with an Apache .htaccess and .htpasswd file. When having that in place the request to the Twitter parser script doesn't work as Apache will under water request a password. Anyone have ideas how to work around that?

Thanks again!

Mies


try this, with the proper username/password: http://username:password@hostname/...

I tried this setup but then the feed goed back to reporting a "0" in the error description top right on the page. This is similar to calling the Twitter parser without the "user:password@hostname" setup.


lbb wrote:I guess that is exactly what the "Authentication" setting is for in the feed settings? Enter your name and password there that you use for the protected site.

...

I think the Authentication is there to login to password protected feeds, not so much to 1st access through the Apache login setup as I am trying to do.


jdelamater99 wrote:Does it work if you put the script in the protected folder? Or maybe put it outside the protected folder.

Those are just guesses. An Apache specific forum might be more useful for your .htaccess authorization question.

With the Twitter parser using a config.php of it's own I'm running it from it's own directory, much like specified in the 1st post and readme.


Thanks,

Mies

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

Re: Twitter RSS Feeds

Postby reibuehl » 20 Jun 2013, 15:42

Hi,

I am currently testing with latest version of this script from git (https://github.com/jdelamater99/Twitter-RSS-Parser).

When I request the feed it works for one screen name but not for one other screen name, I get a file that contains just this:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="atom-to-html.xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>@</title>
</feed>
<!-- vim:ft=xml -->


If I run it with &test I get the following browser output:

Code: Select all

id: NULL
id_str: NULL

Array
(
)


I use the same token/token-secret/etc. successfully with a different php script to access the twitter feed of this screen name successfully.

Any ideas?

Reiner.

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

Re: Twitter RSS Feeds

Postby jdelamater99 » 20 Jun 2013, 17:09

What screen name is it not working with? You can send me a PM if you don't want to reply publicly with it. I haven't come across any screen names that don't work in my testing.

lbb
Bear Rating Trainee
Bear Rating Trainee
Posts: 7
Joined: 18 Jun 2013, 20:30

Re: Twitter RSS Feeds

Postby lbb » 20 Jun 2013, 17:20

Mies wrote:
lbb wrote:I guess that is exactly what the "Authentication" setting is for in the feed settings? Enter your name and password there that you use for the protected site.

...

I think the Authentication is there to login to password protected feeds, not so much to 1st access through the Apache login setup as I am trying to do.

I just tried on my server, it's Nginx instead of Apache though, but works the same.
When I added http://myserver/protected_folder/?screen_name=someone without authentication settings, TT-RSS would complain that it got an HTTP 401 error. Then I set my username and password under "Authentication" and it worked immediately.

What you could also do is to add "ALLOW FROM 127.0.0.1" to your .htaccess, assuming that your TT-RSS parser is on the same server.

jclamen
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 17 Jun 2013, 19:21

Re: Twitter RSS Feeds

Postby jclamen » 21 Jun 2013, 01:03

I modified the script to retrieve the results of a Twitter search. Since it was kind of hassle, I'm sharing the changes here. This is a diff between an earlier version of twitter_parser.php and my version. The search string is hardcoded and I didn't bother removing the stuff that is no longer relevant.

11c11,12
< $path = '/1.1/statuses/user_timeline.json'; // api call path
---
> //$path = '/1.1/statuses/user_timeline.json'; // api call path
> $path = '/1.1/search/tweets.json'; // api call path
23,25c24,27
< 'screen_name' => $sn,
< 'count' => $cnt,
< 'exclude_replies' => 'true'
---
> // 'screen_name' => $sn,
> // 'count' => $cnt,
> // 'exclude_replies' => 'true'
> 'q' => 'SEARCH STRING'
78c80,84
< $options = array( CURLOPT_HTTPHEADER => array("Authorization: $auth"),
---
> // including the query details and the authorization in the headers is crucial
> // the authorization and the query details could probably be left away from the query above
> $options = array(
> CURLOPT_HTTPHEADER => array("q: SEARCH STRING"),
> CURLOPT_HTTPHEADER => array("Authorization: $auth"),
115c121,124
< print('<title>@'.$twitter_data[0]['user']['screen_name'].'</title>'. PHP_EOL);
---
> print('<title>SEARCH STRING</title>'. PHP_EOL);
>
> // search results include an additional layer before we can get to the data
> $twitter_data = $twitter_data['statuses'];

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

Re: Twitter RSS Feeds

Postby jdelamater99 » 21 Jun 2013, 03:48

jdelamater99 wrote:What screen name is it not working with? You can send me a PM if you don't want to reply publicly with it. I haven't come across any screen names that don't work in my testing.


version .9 adds support for home timeline
only parameters for it are
home (required)
count (optional)

your_URL_here/path_to_twitter_parser?home

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

Re: Twitter RSS Feeds

Postby jdelamater99 » 21 Jun 2013, 03:50

jclamen wrote:I modified the script to retrieve the results of a Twitter search. Since it was kind of hassle, I'm sharing the changes here. This is a diff between an earlier version of twitter_parser.php and my version. The search string is hardcoded and I didn't bother removing the stuff that is no longer relevant.

11c11,12
< $path = '/1.1/statuses/user_timeline.json'; // api call path
---
> print('<title>SEARCH STRING</title>'. PHP_EOL);
>
> // search results include an additional layer before we can get to the data
> $twitter_data = $twitter_data['statuses'];


Your formatting looks like it got all jacked up there.

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

Re: Twitter RSS Feeds

Postby reibuehl » 21 Jun 2013, 10:06

Thanks very much for supporting home timeline! You are amazing!

Astalaseven
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 22 Jun 2013, 13:20

Re: Twitter RSS Feeds

Postby Astalaseven » 22 Jun 2013, 13:30

Hi!

I made a little python script that doesn't make use of Twitter API, it is available on Github: https://github.com/Astalaseven/twitter-rss
It can be used to generate a feed based on an user or hashtag. Several ways are possible to create a feed: using the web form, going to your_server/user/chosen_user.xml or your_server/htag/chosen_htag.xml and finally using the file that contains all the user/htag: user/user.txt and htag/htag.txt

The twitter_rss.py file can work alone to update the feeds if they can be found in the specified files. It is lighter than launching the whole webserver ^^

Perhaps it can be helpful for some of you :)

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

Re: Twitter RSS Feeds

Postby jdelamater99 » 23 Jun 2013, 03:44

Nice work, but since the webserver has to be up to run tt-rss, I don't really see that as being an issue. But it might help someone else out. :D

Astalaseven
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 22 Jun 2013, 13:20

Re: Twitter RSS Feeds

Postby Astalaseven » 23 Jun 2013, 17:43

jdelamater99 wrote:Nice work, but since the webserver has to be up to run tt-rss, I don't really see that as being an issue. But it might help someone else out. :D

The webserver doens't need to be up to run the update : the run.py file run in subprocess the webserver, and then begin updating the feeds, using the twitter_rss file.
You can without problem comment the lines used to run the webserver :

Code: Select all

# Launch web server
p = subprocess.Popen(['/usr/bin/python2', 'server.py'])

and

Code: Select all

p.kill() # kill the subprocess


And you can control the time between two updates updating the config.py file :

Code: Select all

TIMER = 600

liquidblasted
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 24 Jun 2013, 12:16

Re: Twitter RSS Feeds

Postby liquidblasted » 24 Jun 2013, 12:43

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


Hi lem0na,

thnx a lot for the script - it work's fine for user_name, but it won't work for search, for ex., if I trying subscribe to link like:

http://path_to_my_server/twitter/?q=gameaudio

I got the error in tt-rss: 'LibXML error 5 at line 2 (column 1): Extra content at the end of the document'

if open that link in browser, I got the textpage:

Code: Select all

Warning: date_format() expects parameter 1 to be DateTime, boolean given in /home/liquid/public_html/ttrss/twitter/index.php on line 136
tag:twitter.com,2007:Status https://twitter.com/s_machen/statuses/349073537623007232
What's new in the #gameaudio world? ... Need to get back to Uni

]]> 2013-06-24T07:56:31+00:00 https://twitter.com/jessedlemons/statuses/349038581043568640
SoundWorks Collection - The Sound and Music of The Last of Us http://t.co/YgkFCOUYBD #gameaudio

]]> 2013-06-24T05:37:37+00:00 https://twitter.com/philsound/statuses/349023128535568386
@mattesque thanks so much! We had such a great team who worked their butts off. Very happy you enjoyed #TheLastofUs #gameaudio #teamwork

]]> 2013-06-24T04:36:13+00:00 https://twitter.com/ModestoNuts/statuses/348963698406199297
RT @marguliespxp: A reminder, with first pitch on Sundays at 6:05, pre game is at 5:45. http://t.co/5xfT9fv7gL iPhone/iPad: http://t.co/b4V…

]]> 2013-06-24T00:40:03+00:00 https://twitter.com/Mexicanos_MLB/statuses/348963405996105728
RT @Vispoli: Joakim Soria making his second rehab appearance for Frisco. Listen to @nathansbarnett right here: http://t.co/0JFTbQrCgs

]]> 2013-06-24T00:38:54+00:00 https://twitter.com/marguliespxp/statuses/348963364921278464
A reminder, with first pitch on Sundays at 6:05, pre game is at 5:45. http://t.co/5xfT9fv7gL iPhone/iPad: http://t.co/b4VztYDOae

]]> 2013-06-24T00:38:44+00:00 https://twitter.com/leon_giron/statuses/348957417997996032
RT @Vispoli: Joakim Soria making his second rehab appearance for Frisco. Listen to @nathansbarnett right here: http://t.co/0JFTbQrCgs

]]> 2013-06-24T00:15:06+00:00 https://twitter.com/mikeboada/statuses/348957279229444096
RT @Vispoli: Joakim Soria making his second rehab appearance for Frisco. Listen to @nathansbarnett right here: http://t.co/0JFTbQrCgs

]]> 2013-06-24T00:14:33+00:00 https://twitter.com/designerofsound/statuses/348948778553856000
Installing Komplete 8 on my iMac took hours and hours and hours. Not today, Mr. MacBook Pro. Not today. #gameaudio #gamedevelopment

]]> 2013-06-23T23:40:46+00:00 https://twitter.com/MiracleBaseball/statuses/348948003844923392
@conservative22 You can listen at our website. Here is a direct link http://t.co/VRQL8cAjWX Listen on smartphone with the @tunein app

]]> 2013-06-23T23:37:41+00:00 https://twitter.com/CHarris731/statuses/348943828851494912
Rubber match of the series with Mobile! Let's do it! Listen live here. http://t.co/OtGgHQThUu

]]> 2013-06-23T23:21:06+00:00 https://twitter.com/ljs214/statuses/348940797380534273
RT @GameVoices: E3 Watch: Dexter Star Yvonne Strahovski and Other TV Actresses in Video Games. http://t.co/Gb3vnGzNG6 #vo #voiceovers #game…

]]> 2013-06-23T23:09:03+00:00 https://twitter.com/Vispoli/statuses/348940635950174208
Joakim Soria making his second rehab appearance for Frisco. Listen to @nathansbarnett right here: http://t.co/0JFTbQrCgs

]]> 2013-06-23T23:08:25+00:00 https://twitter.com/designerofsound/statuses/348938999521497089
I really need to figure out to install Komplete on my MacBook Pro, but only the apps, not the actual content. Must read. #gameaudio

]]> 2013-06-23T23:01:55+00:00 https://twitter.com/designerofsound/statuses/348938112455569408
What else would I be doing on a Sunday afternoon? #gameaudio #composing #soundeffects

]]> 2013-06-23T22:58:23+00:00 https://twitter.com/MiracleBaseball/statuses/348936393357156353
The Cardinals pick up a run in the 5th and 6th to cut the lead to 7-2. Going to the 7th, listen http://t.co/VRQL8cAjWX

]]> 2013-06-23T22:51:33+00:00 https://twitter.com/Scott_Leo/statuses/348936167225430019
The @CLBClippers trail Lehigh Valley 2-0 in the 3rd inning. Watch at http://t.co/CCVWZYqh7E or listen at http://t.co/nz9nWPNkaN

]]> 2013-06-23T22:50:39+00:00 https://twitter.com/mattesque/statuses/348935450179817473
Little sound design on a Sunday. #gameaudio #gearporn #sounddesign http://t.co/bznuPpmeXT

]]> 2013-06-23T22:47:48+00:00 https://twitter.com/MiracleBaseball/statuses/348928047371669504
Matt Koch launches a two-run homer over the LF fence to push the Miracle lead to 6-0 in the 5th. Listen http://t.co/VRQL8cAjWX

]]> 2013-06-23T22:18:23+00:00 https://twitter.com/DunedinBlueJays/statuses/348926730746068992
Jays trail, 4-1 in the fifth. K.C. Hobson's solo shot is Dunedin's lone hit thus far: http://t.co/bVEjJRADFg

]]> 2013-06-23T22:13:10+00:00


I'm not a programmer, but if you can help with what is wrong in here, I will be really appreciate :)
cos really need to read every tweet via search keyword between a couple of devices - to keep in sync twits which I was already read, and which are new and unread yet.
It was so easy via rss before this Twitter's API update :cry:

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

Re: Twitter RSS Feeds

Postby jdelamater99 » 24 Jun 2013, 19:13

I just updated my script to v1.0!

Search support has been added.
your_URL_here/path_to_twitter_parser?q=foobar

Next up will be URL resolving, but I'm going on vacation at the end of the week, so, it will likely be a couple weeks before that's added.

https://github.com/jdelamater99/Twitter-RSS-Parser

twitterfan
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 13 Jun 2013, 01:58

Re: Twitter RSS Feeds

Postby twitterfan » 24 Jun 2013, 23:25

Hello,

i have a problem: I am using your code and use it within a rss widget in Wordpress. Works fine and now all links also work, but: The feed does not update - there are still tweets from 19th of june... why doesn´t it update? No cache-problem so far... can anyone help me?

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

Re: Twitter RSS Feeds

Postby jdelamater99 » 24 Jun 2013, 23:37

I don't use wordpress, so I won't be much of help with this, but it sounds like the script isn't running or at least not at regular intervals.

When the script runs, it uses the count variable and pulls that many results from twitter. The script itself doesn't do any sort of caching at all, so if it's working it's always pulling down the latest tweets.

Silly question, but have the problem accounts actually posted?


Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest