Categories
Emacs GNU/Linux Free Software & Open Source Tutorials & Tips

Post to WordPress blogs with Emacs & Org-mode

Recently I’ve discovered Org2blog, an Emacs mode to write your blog posts locally using org-mode post them to your WordPress blog in a very fast and easy way.

I’ve written before on how to write your blog posts and publish them using Emacs. Previously, my method of choice was using Weblogger mode. I even wrote some enhancements to it.

The problem I found with this method is that it uses message-mode as its base mode. So you’re basically writing an email. The shortcomings of it were that whenever I wanted to write links, bold text, or any custom formatting generally done through HTML tags, I had to either type out the HTML or temporarily switch to html-mode. That sometimes gave me some problems converting the HTML code into entities, and ended up with a mess to fix at the WordPress editing textarea.

Org-mode (included in Emacs since about version 22.1), if you haven’t heard about it already, is a very good way to take notes, organize your tasks, among other day to day useful things. You also get some basic formatting like bold text and italics, as well as links among many other useful things. Nowadays, I find myself typing things in org files constantly throughout my day, and with all its long list of qualities, it became a more suitable way for me to write blog posts.

Org2blog provides a way to post your Org files or post a subsection of your file with a few keystrokes. All you need to do is clone the repository on your load path directory

git clone http://github.com/punchagan/org2blog.git

Then, add this to your .emacs file

  (setq load-path (cons "~/.emacs.d/org2blog/" load-path))
  (require 'org2blog-autoloads)

Finally set up you blog(s) settings in you .emacs file

     (setq org2blog/wp-blog-alist
           '(("wordpress"
              :url "http://username.wordpress.com/xmlrpc.php"
              :username "username"   
              :default-title "Hello World"
              :default-categories ("org2blog" "emacs")
              :tags-as-categories nil)
             ("my-blog"             
              :url "http://username.server.com/xmlrpc.php"
              :username "admin")))

To start wrigint a new post, you can now use
M-x org2blog/wp-new-entry

Or, as I more frequently use, post a subtree of an existing org file using:
M-x org2blog/wp-post-subtree

I hope you enjoy writing and posting your blog posts within Emacs and Org-mode. I certainly do and has turned out to be a very fast way to quickly draft and later on (even offline) elaborate on the blog post details in a comfortable editing environment. Also you get the added benefit of having a local copy (backup) of your blog posts as Org files.

Categories
personal

Blog Updates

Cleaning up

Photo by DanBrady

There’s been a lot going on during the past months and I haven’t posted much on this pages lately. But finally I’ve come to choose a new blog theme and doing a bit of clean up around here.

It all started with me doing lots of house chores and cleaning, washing clothes, picking up room, you know, all that stuff that needs to get done every once in a while (actually must be done constantly). Then I looked at my computer and started cleaning up files and old downloads, then doing backups (yes, that also needs to be done frequently) and finally, I managed to upgrade from Debian Lenny (stable) to Debian Squeeze (testing). And ending up with cleaning up the blog and changing the theme.

On the blog side of things, this time I chose to go back to the black text on white background type of blog, just to see how it feels. Maybe I got bored of the darkness of my past theme. I like this one because its very clear and clean.

I’ve also done some clean up of the categories and blog roll links. I hope I didn’t mess up any category’s RSS feed. There was a lot of categories on this blog and that was because I’ve been using WordPress before tags were integrated, so I was using categories as tags. That is no longer necessary since several WordPress releases, so it was just confusing me at posting time and confusing visitors with a big mess.

Hope you like this new theme and hope to keep up with my blogging and publishing more stuff.

Categories
Emacs GNU/Linux Free Software & Open Source

Emacs weblogger mode with WordPress tags support

wordpress tags with weblogger.el mode
I’ve been looking for ways to blog from Emacs and so far my best solution has been to use weblogger.el. This mode supports many blogging platforms through the xmlrpc apis for blogger, metaweblog, livejournal and movable type. For more details about this mode, visit the emacswiki page.

Since this blog is based on WordPress and it supports the metaweblog api, this has worked very well. My only complaint was that since WordPress version 2.6, tag support was added and blogging from Emacs left my posts without tags. So I decided to add the tags support using the mt_keywords method on the metaweblog api, which on WordPress maps to the post tags. All you have to do is add the Summary label on the post header and write down the tags separated by commas.

You can download the patched weblogger.el here. Its based on the latest patched version on the emacswiki page by Tom Robinson which added handling of the <!–more–> tag and added Keywords in the header by default.

Now the only thing I’m missing is uploading images and files with the post.

Categories
Emacs GNU/Linux Free Software & Open Source

Identi.ca mode for Emacs

Status.net logo

Identi.ca is a free software microblogging service, similar to Twitter, based on the Status.net code base. I recently needed to update my status from Emacs, since its faster for me and easier. I’ve been using an an Emacs mode to update my Twitter account, but there was nothing to use for my Identi.ca account. And seeing there’s a Vim plugin, I thought someone, like me, needed an Emacs mode too.

So I forked the original twittering-mode to use it with the Identi.ca platform, using its Twitter compatible api.

System Requirements

  • GNU Emacs 22 or later
  • Linux, Mac OS X, BSD or any Unix based OS (requires wget)

Download

Download the latest stable release of Emacs Identica-mode

Or get the latest development code from the Git repository at
http://git.savannah.gnu.org/cgit/identica-mode.git

Installation

Copy the identica-mode.el file to your Emacs elisp files directory (.emacs.d/ in Ubuntu)
Then add the following to your .emacs (or your preferred customizations file)

;;; Identi.ca mode
(require 'identica-mode)
(setq identica-username "yourusername")

If you want to authenticate using simple authentication, create a file ~/.authinfo with the following contents:

machine servername login yourusername password yourpassword

Replace servername with your server (if connecting to Identica service, use identi.ca as server name), yourusername and yourpassword with your information.

You can also authenticate using OAuth, specially if you log in with an OpenID account which has no password. To use OAuth authentication (requires using oauth.el), add the following to your .emacs file:

(setq identica-auth-mode "oauth")

If you want to post from the minibufer without having identica buffer active, add the following global keybinding. Add this to send status updates

(global-set-key "\C-cip" 'identica-update-status-interactive)


Add this to send direct messages

(global-set-key "\C-cid" 'identica-direct-message-interactive)

Use

To start identica mode type:

M-x identica-mode


the buffer ‘*identica*’ will appear and you can see your friends timeline.

Press the “i” key to toggle icon mode to see user pictures.

Identica Emacs mode

To view your replies timeline

C-c C-r


To view the public timeline

C-c C-a


To view your friends timeline (the default timeline)

C-c C-f


To view a user’s timeline

C-c C-u


To view a group’s timeline

C-c C-g


To view a tag’s timeline

C-c C-t

To refresh the buffer’s timeline press “g”.

To post an update of your status, press

C-c C-s


type your message in the minibuffer, and hit Enter. You will see ‘Success: Post’ in minibuffer.

Identica mode for Emacs - Update status

To send a direct message to a user, press

C-c C-d


On the minibuffer, you will be prompted for the username, then for the message.

To repeat (re-dent) a message, press

C-c RET

while the cursor is on the message’s line.

To favor a message, press the “F” key (shift f) while the cursor is on the message’s line.

Additionally, you while typing your message you can press <F4> key while the cursor is over a URL to shorten it using any of the following URL shortening services: Ur1.ca, TightURL, Goo.gl, TinyURL, To.ly and Is.gd. To expand an short url in your timeline, position your cursor over the short url and press ‘e’ key, it will be replaced with the expanded version in a few seconds.

Hope it can be of use for anyone using Emacs for almost everything, like I try to do, and would like to hear some feedback.

Contribute

If you have any ideas for features, patches or bug fixes, please add them to the identica-mode bug tracking list.

You can also help out if you’ve liked Emacs identica-mode and have some spare change. It would be great to support this project by making any kind of donation on the “tip jar” in appreciation of the hours invested on its development and improvement.





Categories
personal

Actualizando a WordPress 2.3

Wordpress 2.3
Hoy he actualizado este blog a la nueva version de WordPress 2.3 que salio hace algunos dias.

La actualizacion fue muy sencilla, solo descomprimi el archivo .tar.gz (en mi caso), reemplace todos los archivos viejos por los nuevos, despues entre a la pagina de upgrade, y listo! No tuve que modificar nada mas, y por lo que veo hasta ahorita, no tengo ningun problema.

Veo que ahora hay un sistema de tags nativo en WordPress…ahora que voy a hacer con mi ultimate tag warrior plugin? Ya vere mas adelante que otras mejoras trae esta nueva version.

Por lo pronto, estoy contento con que nada se haya roto en el proceso de actualizacion….

Hmm…justo cuando estaba por terminar este post, me aparecio arriba de mis botones de Publish y Save un mensaje de error:


WordPress database error: [Table 'nopublicaremidatabasename.wp_post2cat' doesn't exist]
SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM `wp_posts` p LEFT JOIN `wp_post2cat` pc ON p.ID = pc.post_id LEFT JOIN `wp_categories` c ON pc.category_id = c.cat_ID WHERE post_status = 'publish' GROUP BY cat_ID
0

—— Correcciones ——-

Pues resulta que ya no tengo que preocuparme del Ultimate Tag Warrior plugin, porque es incompatible con WordPress 2.3, al menos en la version 3.1415…(pi?) y por eso me daba ese error. Tambien si tienen en Google sitemap plugin hay queactualizarlo a la version >= 3.

Con esos cambios se acabaron mis problemas mencionados arriba.
Mas informacion acerca de esto lo pueden encontrar en: http://wordpress.org/support/topic/135564
——————————
Ah, otra cosa que note es que en la seccion de plugins ahora te notifica si hay una nueva version de tus plugins para que los actualices. Que buena idea.