Showing posts with label rss. Show all posts
Showing posts with label rss. Show all posts

Sunday, 7 April 2013

Installing Tiny Tiny RSS on Bluehost/Hostmonster (v1.7.8)

People report that works for other shared hosts, like Hostmonster. And see the comments on the previous post, for potential help with any problems you may encounter.

Installation steps

To actually get to the point you have a working installation of Tiny Tiny RSS on Bluehost, the following steps are adapted from the basic installation notes:

  1. Download and extract the source code for Tiny Tiny RSS for version 1.7.8. Later versions may change in ways where the following instructions no longer work.
    cd public_html
    wget -c "https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.7.8.tar.gz"
    tar xzf 1.7.8
    mv Tiny-Tiny-RSS-1.7.8 tt-rss
    cd tt-rss
    .
    Note that GitHub serves a file named "1.7.8", so the tar command needs to specify that file name and not the one given to wget. Note that "tt-rss" is used in the SELF_URL_PATH configuration variable mentioned below, and maps to this sub-directory you've created in your "public_html" directory. If you plan to use a unique and secret directory name, you'll need to change both these locations.
  2. Open a web browser to the Bluehost cpanel.
  3. Create the database and database user there, as per Bluehost's instructions.
  4. Import the tt-rss database schema, replacing [user] and [database] respectively with the values you used in cpanel.
    mysql -p -u [user] [database] < schema/ ttrss_schema_mysql.sql
  5. Make the configuration file that Tiny Tiny RSS expects, and prepare to start editing it.
    cp config.php-dist config.php
    nano -w config.php
  6. Edit the following variables within the configuration file:
    • DB_TYPE to "mysql".
    • DB_USER to your user name.
    • DB_NAME to your database name and DB_PASS is of course your database user password.
    • SELF_URL_PATH to incorporate your host name (this must map to the directory name it was extracted to).
    • PHP_EXECUTABLE to /usr/php/53/usr/bin/php.  The tt-rss website states that PHP 5.3 or newer is required, however by default PHP_EXECUTABLE points to version 5.2 of PHP on Bluehost.  Go to the PHP Config button in the Bluehost cpanel and select PHP 5.3 there, this will set your php.ini in your public_html directory and other things.
    • Maybe ENABLE_GZIP_OUTPUT to true. If you do not know that your PHP installation supports GZIP, then go to the extra section below related to checking PHP suitability.
At this point, you should open your browser and view the address in SELF_URL_PATH. It should show you the next screenshot. If you do not see the Tiny Tiny RSS login screen, you have done something wrong.

Securing your installation

At this point you will see the following web page. Log in using the default login name which is "admin" and the default password, which is "password". We will proceed to chance these.


Select the preferences item in the menu on the top right hand side of the feeds view.


Select the rightmost pane, which is the "Users" pane where we will change your password.


Check the "admin" user, and click the "Edit" button in the row above it.



Importing Google Reader data

Tiny Tiny RSS supports importing two things, feed subscriptions, and starred items. Go to Google Takeout and get your Google Reader data. If you do not know how to do this, google how to do it. You should get a zip file with "subscriptions.xml" and "starred.json" files within it (among others). Extract these two files somewhere convenient.

Enable importing from Google Reader. Go to the Plugins sub-pane on the main Preferences pane.


Within the Feeds pane, select the OPML sub-pane and import your "subscriptions.xml" file. If you return to the main view, exiting the preferences screen, then you should see these subscriptions populating the left-hand side of the page.


Within the Feeds pane, select the 'Select starred or shared items from Google Reader' sub-pane. Import your "starred.json" file. This will eventually popup a dialog telling you how many items were imported.


Time to populate the feeds, and then to have them populated automatically from then on.

Automatically updating your feeds

Your feeds have been entered in Tiny Tiny RSS, but it still needs to update your feeds and fetch the new items for you.

This will not fetch all the items you have in Google Reader. This is because feeds offer a set number of recent items, and not all items ever posted to them in the past. Tiny Tiny RSS is not intended to keep older items indefinitely, and from what I can tell users are expected to have it discard them after holding them for a limited period of time.

Do an initial fetch with the following command line:
cd ~public_html/tt-rss
/usr/php/53/usr/bin/php-cli update.php --feeds
If you are successful, this will output the following:
...
[22:11:04/12302] Base feed: http://simple-green-frugal-co-op.blogspot.com/feeds/posts/default
[22:11:04/12302]  => 0000-00-00 00:00:00, 100
...
[22:11:09/12302] Sending digests, batch of max 15 users, headline limit = 1000
[22:11:09/12302] All done.
[22:11:09/12302] Feedbrowser updated, 340 feeds processed.
[22:11:10/12302] Purged 0 orphaned posts.
[22:11:10/12302] Cleaned 0 cached tags.
This may not fetch all your feeds. If it hasn't fetched a feed this is okay, it will eventually fetch it, and is likely limiting the server load per attempt.

Now that you know updating is working, add this as a cron job so that it happens every 30 minutes. Return to your Bluehost control panel and find the 'Cron jobs' link. On the cron jobs page, add a new one that happens twice an hour, with the following command line:
cd /home/disinter/public_html/tt-rss2 && /usr/php/53/usr/bin/php-cli /home/disinter/public_html/tt-rss2/update.php --feeds >/dev/null 2>&1
You will of course need to replace "disinter" with your own Bluehost account name.



Extra: The missing manual

Between the bugs and the lack of documentation, I have several things I wouldn't want to have to work out again due to the extra confusion they caused and the time they wasted:
  • Selecting "Use less traffic" when logging in will cause images to be displayed as links.
  • It is not possible to cache images locally (when feeds are updated) as a global default setting, each feed should be manually set to have this option in Preferences. The best time to do this is just after the feeds are imported (or manually added), and before they are updated for the first time.

Extra: Checking PHP suitability

If you are using a web host that is not Bluehost, you might wish to verify that the version of PHP available to you, is suitable.

The main tt-rss page lists required PHP modules, which are mbstring and json.  These are present on Bluehost, and can be seen by reading the following generated file:
echo "" | php > phpinfo.html
pcntl is also installed, which is said to allow forked updating of subscriptions I guess.  php_basedir has no value, which should mean unlimited open files, but Bluehost may have some other resource limiting in place.  allow_url_fopen is on.  So it all looks good.

Extra: Hostmonster confirmation

Hostmonster is exactly the same as Bluehost with a different logo and a different name. I've switched my hosting to Hostmonster, and setting up tt-rss there is exactly the same as for Bluehost.

Saturday, 16 March 2013

Installing Tiny Tiny RSS on Bluehost

This post is obsolete, go to the updated post.

Scroll down past the installation steps, to see screenshots.

Here's my initial list of steps to install Tiny Tiny RSS on Bluehost, following the installation notes:

  1. Download the source code.
    wget -c "https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.7.4.tar.gz"
  2. Unpack it.  Note: GitHub appears to give a download filename of "1.7.4"
    tar xzf 1.7.4
    cd 1.7.4
  3. Open a web browser to the Bluehost cpanel.
  4. Create the database there, as per Bluehost's instructions.
  5. Import the tt-rss database schema.
    mysql -p -u [user] [database] < schema/ ttrss_schema_mysql.sql
  6. Rename, read and modify the config file.
    cp config.php-dist config.php
    nano -w config.php
  7. config.php changes: DB_TYPE to "mysql", DB_USER to your user name, DB_NAME to your database name and DB_PASS is of course your database user password.  Also SELF_URL_PATH to incorporate your host name.
  8. config.php changes: You need to change PHP_EXECUTABLE to /usr/php/53/usr/bin/php.  The tt-rss website states that PHP 5.3 or newer is required, however by default PHP_EXECUTABLE points to version 5.2 of PHP on Bluehost.  Go to the PHP Config button in the Bluehost cpanel and select PHP 5.3 there, this will set your php.ini in your public_html directory and other things.
  9. The main tt-rss page lists required PHP modules, which are mbstring and json.  These are present on Bluehost, and can be seen by reading the following generated file:
    echo "" | php > phpinfo.html
    pcntl is also installed, which is said to allow forked updating of subscriptions I guess.  php_basedir has no value, which should mean unlimited open files, but Bluehost may have some other resource limiting in place.  allow_url_fopen is on.  So it all looks good.
  10. Put the "1.7.4" directory in place.  In my case, I had set my SELF_URL_PATH to disinterest.org/tinytinyrssx, so I executed the following:
    mv 1.7.4 public_html/tinytinyrssx
  11. You'll probably want to look into this if you're migrating from Google Reader.  It mentions a script that will import more of your Reader data than just the OPML subscriptions.
  12. Open your SELF_URL_PATH in your web browser.
At this point I saw the following:


Bluehost does not allow background processes, and in kills long running ones.  So I opted out of the background daemon feed updating approach, and went with a CRON job.  The given link suggests executing the script twice an hour, and gives the basic command line to use.
cd /home/disinter/public_html/tinytinyrssx && /usr/php/53/usr/bin/php /home/disinter/public_html/tinytinyrssx/update.php -feeds >/dev/null 2>&1
Filling in the form, like so:


Now, I was wondering what the login name and password was, or how to set them.  The installation notes are clear that you should log in with "admin" and "password" respectively.  You can change them once logged in through the Preferences menu, which is the first menu item in the Actions menu in the top right hand corner.

Having logged in:


The Feeds tab in the Preferences menu:


The OPML tab (the button is in the lower portion of the previous screenshot):


Having pressed "Import my OPML":


And back to the article view:


Nothing to see yet, I guess no updating has happened.  Looking at the CRON job, it was discarding output. I deleted the CRON job and executed the script by hand to find out it was erroring.

The reason for the error is that Tiny Tiny RSS does not support shared hosts, or so they say on their homepage.  What this appears to mean, is that sites like Bluehost which sell people like me accounts, sell accounts that run on shared hosts.  So the tt-rss update.php script when run from the command line does not have support for command line arguments.  I manually modified update.php and hard-coded a command line argument of -feeds.  This gave the following output, after an initial delay:
Content-Language: auto
Content-Type: text/html; charset=
[01:13:02/11932] Scheduled 100 feeds to update...
[01:13:03/11932] Expiring cache/simplepie
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Expiring cache/images
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Expiring cache/export
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Removing old lock files...
[01:13:03/11932] Removed 0 files.
[01:13:03/11932] Feed: http://community.livejournal.com/tads3/data/rss, 0000-00-00 00:00:00
...
[01:18:36/11932] Sending digests, batch of max 15 users, headline limit = 1000
[01:18:36/11932] All done.
[01:18:37/11932] Feedbrowser updated, 340 feeds processed.
[01:18:37/11932] Purged 0 orphaned posts.
[01:18:37/11932] Cleaned 0 cached tags.
And returning to my Tiny Tiny RSS website, updates have been pushed to my web browser:


However, there are obviously over 1000 articles unread.  Why are only four displayed?  This is because of the "Special" category shown in the left hand pane.  Within this, I can see that I am seeing "Fresh articles", which obviously are those unread and recent.  By selecting the "All articles" Special entry in the left hand pane, then ensuring "Unread" is selected in the first drop down in the right hand pane (see last screenshot, where it is already there for the "Fresh" articles).  Then I actually get all unread articles.

All the unread articles (which I've previously read on Google Reader) can be marked as read in the Actions menu.  However, the UI does not appear to update, and a manual refresh of the web page is needed. Otherwise, that's it.  The CRON job takes care of further updates. 

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) ) {

Google Reader alternatives

Google Reader, which I use everyday, is going to be shut down by Google on July 1st. Ideally I'd be able to google "google reader alternatives" and find one, but unfortunately all the search results are people just making filler posts and stories for various sites. That's one of the problems with the internet, too many people posting helpful information about things they haven't actually tried. The reddit comments on the subject are mostly from frustrated people venting outrage.

Alternative #1: My own internet accessible site

It seems like the best option is to host one of the similar open source projects myself. In order for this to be a reasonable replacement for Reader, I would need to do so on a public server somewhere. Benefits:

  • Permanent record of interesting sites. If in the past I read and star a blog post, what is to say that the site the post came around will still exist? Or be in the Internet Archive? Or would have even be kept around in Google Reader, had it continued indefinitely?
  • Ability to customise the code for personal preference.
Costs:
  • Hosting costs. I currently pay Bluehost around $104 USD a year to have a web site and shell account. I could install one of the alternatives there, but I was already intending to close my account. It might be worth my while to sign up elsewhere for a longer term, like Hostmonster for 3 years at ~57% of the Bluehost price
  • Maintenance burden. How often are security problems found in PHP these days? There's also the random assortment of other weird dependencies that people burden their software these days.
This solution also lacks the one single interesting benefit of the more "social" alternatives, the ability to get recommended content from other users with the same interests. However, Google Reader had this feature, and it's recommendations were a waste of time.

Tiny Tiny RSS looks like the most appealing project to me.

TLDR: Maybe, but it would be a lot of work.

Alternative #2: The Old Reader

People suggesting The Old Reader as an alternative mention it is like "the old Google Reader."


In the Reddit thread, people dismiss it because it requires you to use your Google account or Facebook account to log in.


I'm with them.  This rules out this alternative for me.  Even if it didn't there's little to show what this site offers, or whether it costs money, or even besides what the name hints at.. what it actually is.  The tour page seems more like a basic make-do step by step tutorial than an actual tour of the features.

TLDR: Can't access it and not sure what it actually is.

Alternative #3: Bloglines

I signed up for Bloglines, exported my Google Reader subscriptions using Google Takeout, and imported them with little difficulty.  The default view is some complicated image-based one, that only shows bits of images and bits of post name.


I can change this to a list view.


But it makes strange alterations to browser behaviour.  If I try and scroll up when viewing a post, it doesn't inch up as it would for a normal web page.  Rather it jumps some arbitrary amount, so I end up going up and down trying to view the right parts of image and text.  If I press space, it jumps to the next oldest article.  No more press space to page down, as a standard web page behaviour.

One thing I appreciated about reader, was that reading the next unread article took me to the next newest article.  In this way, I would catch up on what had left to read.  Bloglines however reads from newest to oldest.  This is not useful to me, and it doesn't appear possible to change it.

Bloglines is still giving me extra unread articles for various subscriptions occasionally when I log in -- like those Paizo articles from 2010 which are shown in the screenshots.  This would seem to be the subscriptions it didn't already have indexed for other people, like custom RSS feeds for forum threads.  That's fine.

TLDR: UI too fancy, and works in arbitrary ways.  But better than nothing.


Alternative #4: Feedly

Feedly is apparently based on Google's Google Reader API, so it is really just a way of viewing Google Reader content.  This means it is another website that needs your Google login, although justifiably so to allow you to read and manage your subscriptions in Google Reader.  They plan to make their own API to replace that of Google's when Reader is phased out.


It's not really a Google Reader replacement in any case.  You need to have local clients installed, and can't just go to a website to catch up.  What if I am in a web cafe, or borrowing someone else's computer?  The only time I would want a custom client would be if it downloaded all the latest state to my computer or mobile device and allowed me to completely read offline.  That would be really nice actually, and I wouldn't be surprised if it was what Feedly does.

But what does Feedly do?  How does it work?  Does it cost money?  Will it cost money?  This is another of those modern web sites that you can sign up to use something, or install something, but they don't really tell you what that something is.

I installed the Feedly Google Chrome app, and it promptly invited itself to start Chrome when Windows starts.  That's another slowdown on startup, for an inscrutable application which is thought to read blogs and whatnot, but how it allows me to do this is again inscrutable.  At this point, I uninstalled it and moved on.

TLDR: This website has no helpful content besides installation options.  If you use it, let me know what it is.

Browsing the comments for their announcement blog post, where they mention how they will transition after the Google Reader API is closed down, there are some tidbits.  Whether it is offline, whether there is a cost to use now, or a future cost, etc.

From what I can tell, and it's unfortunate I have to try and work it out this way:

  • Feedly does not have an offline mode.
  • They may have web-based access in the future, but do not at this time.
  • It has ability to sort from oldest to newest articles, but only on individual feeds.
  • DATA LOSS: If you have old subscriptions in Google Reader for websites that no longer exist, allowing you to access the otherwise no longer accessible articles, Feedly will lose that data when it transitions to it's own API.
  • DATA LOSS: It does not import tags from Google Reader, although there is reported to be a hacky workaround.
  • DATA LOSS: People report it not importing all subscriptions, requiring people to manually resubscribe.


Conclusion

I've looked at several other alternatives that appear to be more of the same.  But at this point, I think it's obvious that the existing alternatives are too fancy, and the fanciness gets in the way of usability.  That's assuming I can even work out what exactly an alternative is, from it's website. One of the things I appreciate more and more about Google Reader, is that it is simple and works in all the different ways I need it to.

It looks like the way forward for me from here, is to install one of the self-hosted alternatives into my Bluehost-hosted website.  And to buy a cheaper longer term plan from another hoster that offers shell access, once my Bluehost package expires.