Page 1 of 2

Article on how to set up TTRSS with Bluehost

Posted: 18 Mar 2013, 04:11
by Aldursil
Using the linked article I was able to get TTRSS working with Bluehost. It requires you to edit the update.php file. Before doing this I had to use the wget method of updating. Now I can use the second option from the update settings recommendation.

http://posted-stuff.blogspot.com/2013/0 ... mment-form

Re: Article on how to set up TTRSS with Bluehost

Posted: 24 Mar 2013, 01:18
by Aldursil
This no longer works with 1.7.5. Might someone know how to take the article and then apply it to 1.7.5 so cron jobs will work again?

Thanks

From the article...

Edit: Changes to update.php..
...
init_connection($link);

// INSERT A HARD-CODED $argv VALUE
$argv = array('-feeds');
$op = $argv;

// CHANGE THIS IF STATEMENT TO BE THIS
if (count($argv) == 0){ // && !(defined('STDIN') || (substr(PHP_SAPI, ...
?> <html>
<head>
<title>Tiny Tiny RSS data update script.</title>
...
}

// CHANGE THE || TO && TO GET THIS TO WORK
if (count($argv) == 1 && in_array("-help", $op) ) {

Re: Article on how to set up TTRSS with Bluehost

Posted: 24 Mar 2013, 02:11
by ebell451
Per the information on this post: viewtopic.php?f=1&t=1456, you need to change the cron job

from

Code: Select all

cd /home/disinter/public_html/tinytinyrssx && /usr/php/53/usr/bin/php /home/disinter/public_html/tinytinyrssx/update.php -feeds >/dev/null 2>&1

to

Code: Select all

cd /home/disinter/public_html/tinytinyrssx && /usr/php/53/usr/bin/php /home/disinter/public_html/tinytinyrssx/update.php --feeds >/dev/null 2>&1


basically, add a - in front of -feeds

Re: Article on how to set up TTRSS with Bluehost

Posted: 24 Mar 2013, 02:41
by Aldursil
I have the cron job set to do that. When I try it manually it does not work. The update script needed to be updated to allow command line parameters to work with Bluehost. With the update it does not work anymore even if I use "--feeds". The script I posted in my previous post needs to be modified for 1.7.5 but I do not know what needs to be change.

Re: Article on how to set up TTRSS with Bluehost

Posted: 25 Mar 2013, 13:20
by Myx.Ostankin
Aldursil wrote:I have the cron job set to do that. When I try it manually it does not work. The update script needed to be updated to allow command line parameters to work with Bluehost. With the update it does not work anymore even if I use "--feeds". The script I posted in my previous post needs to be modified for 1.7.5 but I do not know what needs to be change.


In 1.7.5 the change appears to be even simpler. I changed the following line:

Code: Select all

$options = getopt("", $longopt);

into this:

Code: Select all

$options = array("feeds" => false);


Yet I have another problem. Not sure yet who is to blame: TTRSS, Bluehost or myself, but I can't load protected livejournal feeds. Entering http://username.livejournal.com/data/atom?auth=digest as a feed url and supplying correct username/password fails with HTTP 401. While entering the same url in a browser directly works fine.

Does anyone else have this issue?

Re: Article on how to set up TTRSS with Bluehost

Posted: 25 Mar 2013, 13:28
by fox
I tested basic protected feeds recently for an unrelated issue and they worked. Maybe they require digest now or something?

This could also theoretically be affected by curl missing and some esoteric setting in php preventing stuff from working. Do you have CURL?

Re: Article on how to set up TTRSS with Bluehost

Posted: 25 Mar 2013, 13:44
by Myx.Ostankin
fox wrote:I tested basic protected feeds recently for an unrelated issue and they worked. Maybe they require digest now or something?

Livejournal have used digest since time immemorial for what I know.

fox wrote:This could also theoretically be affected by curl missing and some esoteric setting in php preventing stuff from working. Do you have CURL?

Bluehost claims to have CURL, but googling this topic indicates that some people had problems with it. Anyway, my gut feeling is that the problem comes from Bluehost. I'll try running TTRSS on a different hosting and see if this helps. Will post here as soon as I get any results.

Re: Article on how to set up TTRSS with Bluehost

Posted: 25 Mar 2013, 13:46
by fox
I'm not sure if php supports digest, CURL should be able to.

Re: Article on how to set up TTRSS with Bluehost

Posted: 26 Mar 2013, 05:49
by Aldursil
Myx.Ostankin wrote:
Aldursil wrote:I have the cron job set to do that. When I try it manually it does not work. The update script needed to be updated to allow command line parameters to work with Bluehost. With the update it does not work anymore even if I use "--feeds". The script I posted in my previous post needs to be modified for 1.7.5 but I do not know what needs to be change.


In 1.7.5 the change appears to be even simpler. I changed the following line:

Code: Select all

$options = getopt("", $longopt);

into this:

Code: Select all

$options = array("feeds" => false);



Thanks! This worked for me as well.

Re: Article on how to set up TTRSS with Bluehost

Posted: 27 Mar 2013, 01:38
by Myx.Ostankin
Myx.Ostankin wrote:
fox wrote:This could also theoretically be affected by curl missing and some esoteric setting in php preventing stuff from working. Do you have CURL?

Bluehost claims to have CURL, but googling this topic indicates that some people had problems with it. Anyway, my gut feeling is that the problem comes from Bluehost. I'll try running TTRSS on a different hosting and see if this helps. Will post here as soon as I get any results.

I tested on my own home linux server and got the same 401 error - which means this is unlikely an issue with Bluehost. I'm running Debian 6, php version 5.3.3, curl version 7.21.0, and I can't see if there's anything else that may be wrong with my configuration.

Shall I report a proper bug with all the logs, screenshots and a test LJ account for illustration? I assume this is meant to work after all, since Livejournal protected feeds are even mentioned in the list of features...

Re: Article on how to set up TTRSS with Bluehost

Posted: 27 Mar 2013, 02:09
by Latimer
Would you be willing to try a different URL? I just subscribed to http://<ljname>.livejournal.com/data/rss?auth=digest, and I could see the protected posts.

PS. Cool trick by the way, I had no idea.

Re: Article on how to set up TTRSS with Bluehost

Posted: 27 Mar 2013, 09:02
by fox
That was the URL I used when I had a livejournal account.

Re: Article on how to set up TTRSS with Bluehost

Posted: 27 Mar 2013, 10:59
by Myx.Ostankin
Looks like I have found where the problem is. I played with different accounts and noticed that sometimes authorization fails, sometimes doesn't. I'm not 100% sure yet, but it looks like it depends not on the URL (both rss and atom are good), but on the password. I happened to have a ":" character in my password and this turned out to be the culprit.

I played a bit more and found that there are other characters that cause the same problem, namely "@", "[", "]" - maybe there are more of them. Strangely, "-" is fine.

Example: user having a password ttrssD1gest authenticates successfully, but after changing the password to ttrss:D1gest the same user gets 401.

Changing password helped, but this still looks like a bug somewhere on TTRSS side, as authentication in a browser works with any password.

Re: Article on how to set up TTRSS with Bluehost

Posted: 27 Mar 2013, 11:37
by fox
looks like an urlencode missing to me, yeah

Re: Article on how to set up TTRSS with Bluehost

Posted: 27 Mar 2013, 12:22
by fox
Okay, so I managed to fix this for CURL which apparently doesn't need urlencoded password. Unfortunately, the native php file_get_contents() doesn't want to download stuff whether the password is urlencoded (like it should be) or not. Not sure how to proceed further.

https://github.com/gothfox/Tiny-Tiny-RS ... 3a94a4e5d8

Edit: used the same password as above with a few more special characters added.