Howto: Iron Blogger Script (English Version)

20 01 2012

Please excuse my really bad English. I did my best to write this post reasonably understandable.
Perhaps there is someone who helps me and corrects my mistakes.

This howto is available in German too.

As mentioned in my last post, there is the Iron Blogger script running on my server the with some adjustments.

Here is a brief guide on how to install and use this script. I created a new fork on Github and uploaded my changes uploaded there.

In my post I am assuming that you use Debian. Should you use a different system, please adjust the commands and then the package names.

What needs to be installed?

  • git
  • python
  • python-yaml
  • python-dateutil
  • python-mako
  • python-lxml
  • python-feedparser
  • mutt

How do I install the packages?

Run the following command (even if there appears a line break it’s only a single line):

sudo apt-get install git python python-yaml python-dateutil python-mako python-lxml python-feedparser mutt

Your system will load the required packages and install them. If one of the packages already exist, then it is skipped automatically.

How do I get the Iron Blogger script?

Changes into the directory where you want to have the Iron Blogger script later run the following line:

git clone https://github.com/chaosblog/iron-blogger.git

This command creates a directory „iron-blogger“ and downloads the script from Github.

What do I need to prepare?

Create a new page for the list of participants, the title you can choose at will.

Don’t write any text at this page – Any content of this will be overwritten by a generation of participant list.

Navigate in your WordPress admin interface to „Pages“. In the list of available pages appears the newly created one. Ride with the mouse over the link and you remember the ID number of the page, it will be used later.

If the link to the page, for example is https://chaosblog.wordpress.com/wp-admin/post.php?post=2&action=edit, then the ID which you have to remember is 2.

What do I need to adjust?

Currently there is no central configuration file.

  1. render.py
    Edit the File render.py. There you configure the start-date of your Iron Blogger Event.
    At Row 13:
    START = datetime.datetime(2011, 12, 25, 2)
    The dateformat is: yyyy, mm, dd, h
    The year (four digits), the month (two digits), the day (two digits), the hour (24 hour format).
  2. update-participants.py
    Edit file update-participants.py, adjust Rows 10-13 angepasst werden.
    XMLRPC_ENDPOINT = 'http://blog-URL.tld/xmlrpc.php'
    USER = 'username'
    BLOG_ID = 0
    PAGE_ID = 12
    The XMLRPC_ENDPOINT is your blog URL followed by „/xmlrpc.php“ (without quotation marks).
    When your blog URL  is https://chaosblog.wordpress.com so the needed value is https://chaosblog.wordpress.com/xmlrpc.php
    USER your username, used at the blog login page.
    Normally the BLOG_ID is 0 (zero) sein
    PAGE_ID is the remembered ID form your participants page.
  3. weekly-update.py
    Edit weekly-update.py similar to update-participants.py – Rows 11-13 need to be adjusted.
    XMLRPC_ENDPOINT = 'http://blog-URL.tld/xmlrpc.php'
    USER = 'username'
    BLOG_ID = 0
  4. bloggers.yml
    The file bloggers.yml contains the participants.
    username:
    links:
    - [Blogname 01,'http://blog-URL.tld/']
    - [Blogname 02,'http://blog-URL02.tld/']
    name: Jon Doe
    start: YYYY/MM/DD
    username corresponds with the bloggers twitter name. You could write any name – but if you don’t use twitter names, you have to edit the templates which generate the overview and the participants list. Both generate username based links for twitter.
    At the section links you have to enter the blog an user is running.
    Don’t add a feed-URL – they will generated later.
    The field name contains the bloggers realname.
    For blogger which will join the project later, there is the „start“ field.
    Caution:The fees are not calculated backdatedHere’s an example to illustrate:
    chaosblog:
    links:
    - [Chaosblog, 'https://chaosblog.wordpress.com/']
    name: Marcus S.
    start: 2012/01/01
  5. email.txt
    Only a short adjustment – replace at row 3 in the file email.txt the string „addyourmail@here“ with your e-Mail-adress.

How do I run the script?

It is not a single script, but several scripts that work together. Therefore, there is a specific order, you must follow.

  1. Add all participants to bloggers.yml.
  2. Run the script import-feeds.py via console:
    ./import-feeds.py

    The file bloggers.yml will be read and the missing feed-URLs will be added.
  3. Now you update the participants list by running:
    ./update-participants.py
    You will be aked to enter your WordPress password.
    After a few seconds the prompt will return and your participants list was updated.
  4. The determination of new contributions of each participant is done by scan-feeds.py. This script loads one after another feed and stores the titles and addresses of the new posts.
    Run this command:
    ./scan-feeds.py
  5. Go on with a dry run of the weekly results. weekly-update.py  with the parameter -n starts the dry run. No blog post will be done and no email will be send. The second parameter at the dry run is a date, formated YYYY-MM-DD (e.g. 2012-01-19)
    ./weekly-update.py -n 2012-01-19
    The date defines the week for the results. Based on the configured start and the parameter the week will be calculated. It is not necessary to start a week on sunday or monday.
  6. Now it gets seriously.
    Let’s generate a blog post and an email. Run the weekly-update.py script only with the date parameter:
    ./weekly-update.py -n 2012-01-15
    You will be asked once more to enter your WordPress-Password.
    After a few seconds your blog post is created and you will receive an e-mail

Finished. That is quite easy. Isn’t it? ;)

To-do:

  • one configuration file
  • store the wordpress password for automation

I’m going to implement both and when finished I will upload it to github again.

Tip: Created just a new WordPress.com blog and turn into private. This you can use as a playground to test everything.

Another tip: when you created just one new WordPress.com blog or another to whom you turn to private. These you can then use as a playground.


Aktionen

Information

2 responses

20 01 2012
Anleitung: Iron Blogger Skript « ChaosBlog

[…] Iron Blogger. Jetzt erst recht. Howto: Iron Blogger Script (English Version) […]

22 01 2012
Results for week beginning 2012-01-15 « Iron Blogger Berlin

[…] Howto: Iron Blogger Script (English Version) […]

Schreibe einen Kommentar

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s




%d Bloggern gefällt das: