URI.LV checks at regular intervals (about once an hour) to check whether your Octopress Atom or RSS feed has been updated. However, if you'd like to notify URI.LV as soon as you publish, and you have a Premium URI.LV account, you can set up Octopress to ping URI.LV when you deploy.
- You use Octopress
- You use URI.LV to manage your Octopress Atom or RSS feed and have a Premium URI.LV account
- You need to make a new API app. Go to http://uri.lv/api and select 'New app'. Fill in the relevant details (you can call the app whatever you like) and create it. At the top of the page you'll see your API key and token listed. Make a note of these, because we need to supply them when using the API.
- There are various ways to store the API credentials, but I prefer to store them as environment variables in a hidden file in my home directory called
~/.secrets
. See file 'secrets' for details, replacing 'YOURKEYHERE' and 'YOURTOKENHERE' with the actual values of yours, of course. If you add the lines shown in 'zhsrc' below to your.bashrc
or.zshrc
then your credentials will be in your environment each time you start your shell. For now runsource ~/.secrets
to set it up. You can check that it worked with the commandsecho $URILV_KEY
andecho $URILV_TOKEN
, and you should see your key and token printed. - You need to have the gem
httparty
installed to add the following line to your Gemfile, inside the development group:gem 'httparty'
. Then you should runbundle install
inside your blog directory to install httparty. - Add lines listed below in the file 'Rakefile' to your Rakefile.
When you deploy your site, instead of running rake deploy
, run rake ping_deploy
. This will first deploy your site by whatever method you usually use (pushing to Github Pages or using rsync) and will then ping URI.LV. If you load the URI for your feed in a browser, you should see that it is immediately updated with your new content. If you want to ping URI.LV separately from deploying, you can just run rake ping
.
I forked your Gist to update it for FeedPress: https://gist.github.com/maximevalette/8b9c3cd4545cc62d5b80