Showing posts with label org2blog. Show all posts
Showing posts with label org2blog. Show all posts

20 December 2010

org2blog There's another org2blog

There's another org2blog

Yesterday I found out that there's another emacs package called org2blog, just like mine. It does roughly the same task, too, just it publishes to Wordpress instead of to Blogger and other Atom API sites.

It looks like its conventions are almost all different. The only thing really the same is the "#+TITLE: " file property.

I emailed the author, suggesting that we should at least try to co-ordinate. I haven't heard back yet.

09 September 2010

org2blog now can upload photos conditionally

org2blog

I added a new interactive function org2blog-dir-add-new-photos, which uploads just the new photos from a given directory.

In doing this, I factored g-client's gphoto-directory-add-photos. Now gphoto-directory-add-photos-x does almost the same thing but takes a test predicate which is called with each photo's filename.

01 September 2010

org2blog again

While I'm thinking about it

Just used my org2blog to upload the last post. Including all the pictures exercised it fairly well. While it's fresh in my mind I have a few comments:

How to use it with pictures

  • (Of course) Write a file that includes pictures.
    • Capture the pictures. I find it's convenient if you put them in a sub-directory of your blogging directory
    • Use C-u C-c l to make links to them
  • Upload the pictures
    • If you have a Blogger account, you have a Picasa account, or you do if you have ever put a picture in your blog. If you don't, you'll have to set something up.
    • Call gphoto-albums twice. The first time, g-client will have an error. It's due to a missing entity, really an upstream problem so I haven't looked at it.
      • If my acute shortage of round tuits ends, I'll make gphoto-choose-album automatically does this.
    • Upload the photos. Usually gphoto-directory-add-photos is most convenient. For single photos, use gphoto-photo-add.
    • org2blog will automatically remember what remote URL they correspond to.
  • Upload the blog entry with M-x org2blog-post

I made gphoto-directory-add-photos easier

Now it picks album names from a list.

Glitch in gphoto

Somewhere in gphoto there was a "bad byte code" glitch. That seems to have been solved by reloading. I'm not sure how serious it is.

gphoto-read-album

I'm not sure what TV Raman planned with this function. It doesn't look like it would work, and I've never used it. However, I fixed what looks like a scoping error that always gave me some byte-compilation bugs. No guarantee from me that it works.

org export can't naturally flow text & pictures

Not a major failing, since it's not really meant as a page designer. But I'd have liked to flow the text around the pictures, and I couldn't without writing the HTML by hand.

20 April 2010

org2blog released

org2blog is now released as alpha quality software

It is released as a tarball of:

  • Org2blog itself
  • Supporting package tinydb
  • Diffs to g-client
    • g-client is by T V Raman
  • Diffs to org-mode
    • org-mode is by Carsten Dominik, with many additions by others including myself.

To run it you'll also need:

  • org-mode
  • To patch org-mode
  • g-client
  • To patch g-client
  • Bravery (or an equivalent amount of foolhardiness)

Some short documentation is in org2blog/README.org Basically:

  • Have a Blogger account
  • M-x gblogger-blog
    • That will give a parse error - T V tells me it's missing an external entity - but it will set up the blog posting url for your blog
  • Write a blog post (which I'm doing right now)
  • M-x org2blog-post
  • And it will appear on Blogger, just like this did (or will).

Summary of changes to g-client

  • User-visible changes
    • Some automatic capture of data, by only these interface functions:
      • gphoto-feeds
      • gphoto-photo-add
      • gblogger-blog
      • gblogger-new-entry
    • Changed gphoto-photo-add to ask for an album name from the list of albums, not an album id number.
    • Added a more flexible way of getting authentication: Just customize (new variable) `g-user-auth-function'
    • Hooks
      • `g-app-afterpost-hook' which should be a function taking 2 args:
        • The source filename
        • The remote url
    • gphoto treats non-jpgs
      • Can find them in directories
      • (Forthcoming) Sends the right Content-Type for them.
      • Uses (both emacs-bundled packages) `image' and `image-file' to know about image file types.
    • g-load-defs.el now can be used as a symlink with my-site-start, because it knows its real location.
  • Internal additions:
    • Added optional arguments to some interfaces
      • Mostly to pass storers around
        • g-app-send-buffer
        • g-app-view
    • Added internal variables
      • To hold captured data
        • gphoto-album-list
        • gphoto-user-api-location
      • To name new XSL scripts
        • g-xsl-blogpost->url
        • g-xsl-photopost->url
        • g-xsl-feed->albums
      • To hold a buffer-local storer until g-app posts
        • g-app-storer
    • Many commands associated with capturing data
      • gblogger-blog-assign-data
      • gphoto-feeds-assign-data
      • g-app-setup-capture
      • g-util-capture-x
      • g-util-capture
    • Created some convenience functions because I found myself repeating code:
      • g-app-shell-command
      • g-app-build-command
      • g-app-build-storer
      • g-app-setup-posting
      • g-app-succeeded
      • g-display-common
    • Changed g-auth to use customizable variable `g-user-auth-function' for initial authentication.
      • Added g-user-default-auth-function, that variable's default value.

Would have liked real test code

I would have liked to write proper test code for this.

Unfortunately, I basically need an immutable remote site to do it. I contacted Google about this but never heard back from them. That made development more difficult.

05 April 2010

More progress on org2blog

Re-intro

Org2blog is an emacs package that I wrote. It's not quite releasable yet, but there is a tarball available for the brave or foolish. I use it to post this blog, because I like to write my stuff in org-mode.

Recent progress

Maps from local filename to remote URL

org2blog now has a persistent map from local filenames to remote URLs. This is useful when posting links to other blog posts or to images that you have locally, as long as you upload them to Picasa (Google's image hosting)

It automatically captures a remote URL when you post to Blogger. But it doesn't yet capture a remote image URL when you post to Picasa, because that process call runs asynchronously, which is more difficult to capture from.

Captures album lists

g-client knew what photo albums were but couldn't capture a list of existing albums. org2blog can.

Made org's html export neater

In the course of doing this, I made org's html exporting slightly cleaner and better factored. However, this is all done thru a file that's loaded on top of org-html.el.

Again, credit to others

Carsten Dominick
org-mode
T V Raman
gclient, particularly gblogger

27 March 2010

org2blog

org2blog runs now

This post is coming to you via software I just wrote called org2blog. Much credit is due to:

Carsten Dominick
org-mode
T V Raman
gclient, particularly gblogger

What's it do?

Right now, with a little clueful setup, it turns org files directly into blog posts. Like this one!

They can even include pictures and links to other posts. (But you have to give a command to post the pictures, it doesn't figure out what's needed)

At the top of this org file I have a few lines:

#+OPTIONS: creator:nil author:nil toc:nil inline-images:t H:4
#+TITLE: org2blog
#+BLOGLABELS: org2blog

Then I command:

M-x org2blog-post

And then you see it on my blog.

When will it be available?

Right now it's a series of files that load after org and gclient and override some of their functions. That's not really a suitable form to release software in.

There is a tarball of it, though, if you're brave or foolish.

What's missing?

Lots of convenience stuff. You really have to know how to set it up. I hope to change that soon (them's famous last words, don'tcha know)

Also testing is largely missing. It works very much thru org-mode and gclient. Org-mode has hundreds (maybe thousands) of configuration variables, and gclient does all its work wrt a remote server. Neither provided mocks of their functionality. So I had no good way of pinning either one down so I could test code that uses it.

Why'd I do it?

I like using emacs org mode a lot better than than using online editors. While I was posting the last three blog entries, I was also developing this.