Showing posts with label movabletype. Show all posts
Showing posts with label movabletype. Show all posts

13 September 2009

Exporting del.icio.us Bookmarks to Movable Type Entries

For years I’ve used del.icio.us to store interesting links. A few weeks ago I started looking for a way to move my large library of links into my Movable Type-powered weblog. You can export links from del.icio.us, but it comes as in the Netscape bookmark, which Movable Type can’t read. This Ask Metafilter post gave me the solution: save del.icio.us’s RSS feed, import it into Wordpress, and then import the Wordpress blog into Movable Type. The method I used is the one user Memo describes here. He’s since written a Wordpress tool that should do it more easily.

Since Wordpress is free and Dreamhost will install it with one click, I set up a temporary blog as a middle man between del.icio.us and Movable Type. A few notes on what I did:

  • Using the RSS Feed method, you only get 100 entries at a time. del.icio.us has a batch edit feature, so if you set your view to see 100 entries per page, you can export the RSS feed and then use batch edit to select all the entries on the page, delete them, and then download a new RSS feed with the next 100 entries. Make a backup of your links first if you do that so that you can restore your backups when you’re done.
  • Wordpress will import del.icio.us’s tags as categories. It has a converter you can use to make them tags.

20 August 2009

Movable Type PubSubHubbub Plugin

Movable Type Plugin to ping Google’s PubSubHubBub when you post. I’ve installed it but don’t know of a good way to test it out.

Update: strike that. FriendFeed displayed this post faster than I could switch windows to watch for it.

10 August 2009

Using Movable Type as a Simple URL Shortener

With today’s news that tr.im is shutting down, I decided to take on a small project and write a URL shortening service within Movable Type. It’s probably not the most elegant solution, and could well break some best practices, but it works for now.

First, I created a new blog in Movable Type. With ely.fm I already have a pretty short address, so I have the blog at http://ely.fm/debigulated/ and will use ely.fm/u/ to redirect URLs from.

Next, I made a new index template that will create an .htaccess file. I set the output file to ../u/.htaccess. The content of the template I used:

<mt:Entries> Redirect 301 /u/<$mt:EntryID$> <$mt:EntryBody convert_breaks="0" encode_ampersands="1"$> </mt:Entries> 

This will use the entry ID of my posts as the short URL slug. It could be shorter if I had a way to convert it to hex or base-36 or something, but it’ll do.

Now, to debigulate a URL, I create a new entry in my new blog. The title is the name of the page I’m linking to, and its body is its URL.

In order to get the short URL I’ve made an index template that shows the short link and the long one. It also provides some semblance of a record of where the short links go if I ever shut down the service. So, edit the Entry Summary template, where it says <$mt:EntryBody$>, to something like:

<p>Short URL: http://ely.fm/<br /> Long URL: <$mt:EntryBody convert_breaks="0"$></p> 

My running list of debigulated URLs is here. (Note: it’s written in HTML 5, just for fun, and I’ve done almost no cross-browser testing. It may look like nonsense in some browsers.) The first set of links will be a running list of URLs I’ve shortened, followed by a list of links to my own blog posts, which also have self-declared shorturls. The short link for the post you’re reading right now is ely.fm/u/464.

I may also include some tracking by turning the links into Bird Feeder seeds. All of this works pretty well, but I’m sure a Movable Type plugin could do it better, or a stand-alone application one could install on a web server. Regardless, it was a good project for me to stretch my brain a little.

06 March 2009

MovableType2Blogger conversion utility

MovableType2Blogger conversion utility

Convert MovableType or TypePad blogs into a format that can be imported into Blogger.

04 September 2007

Movable Type Supports OpenID

The new version of Movable Type has built-in support for OpenID commenting, which is great. I like the approach of presenting people with familiar icons to communicate the idea that the already have OpenIDs, and being able to hide all but the username and fill in the rest, they don’t even need to know that they’re using an OpenID. I’d like to see TypePad and Vox (and Blogger) add in OpenID support like this, too.

24 September 2006

OpenID Server

Very cool: OpenID Server for Movable Type. Just drop it in your Movable Type plugins directory, add one line to your main page’s header, and you can log into any OpenID-enabled site using your own identity, if you don’t have or want to use a TypeKey, LiveJournal, or Vox account.

I’m now accepting comment logins using OpenID, so if you are running your own OpenID server, or have a Vox or LiveJournal account, you can use those identities when you comment (or keep using TypeKey). If you’re already logged in at Vox or LJ, just type in username.vox.com or username.livejournal.com, and the backend will check with that site to make sure you are who you say you are without any need to enter a password.

09 June 2005

The Tags Power Tool for Movable Type

The Tags Power Tool for Movable Type

Movable Type plug-In to replace keywords with tags. I’ll probably install this when I have a chance.

13 May 2004

TrackBack Circle Up

I’ve been debating back and forth with myself about whether or not to send TrackBack pings to sites I link to on eXtremities. My interpretation of TrackBack is this: it lets you read other posts inspired by the one you’re currently reading or written about a similar topic. The other interpretation is that it lets every page contain links to every page linking to it. I don’t think the second version is very useful. What I want in reading a TrackBack is more information or thoughts about a topic. Otherwise following a ping to my linklog just gives you a page linking back to where you found it. Great if you want to click in circles all day, but not very constructive.

My inclination is to only send TrackBack pings when I have something to say about a post, not just whenever I link to one.

Daring Fireball has a lot to say about this. My feeling is that lists of referrers are interesting but not altogether useful, whereas TrackBacks would be used to provide easy extra reading material on a topic. In that vein I almost think people should delete incoming TrackBack pings that don’t have anything but a link in them.

18 March 2004

MT Wishlist

With MovableType 3.0 on the horizon, and with prompting from Kottke’s new integrated design, I’ve been doing some thinking about what weblog software doesn’t do. Here’s a short list of some features I’d like to see in the next generation of personal publishing software. Most of these can be done with clever hacks, but the fact that the hacks exist shows that there’s a need that isn’t being met.

Customized Fields

Separating posts in different categories is often not enough for many people. Suppose I write lots of movie reviews on my page. Putting them all in a “Film” category would useful, but I might also want to group them as “Drama,” “Comedy,” “Action,” etc. While MovableType currently allows posts to be assigned to multiple categories, what I really want in the above scenario is the ability to assign subcategories. The most logical way to do this is to create a weblog just for movie reviews. There are two major roadblocks that prevent this from being an easy solution. The first is a lack of customizable fields, and the second is that there’s no way to stitch multiple weblogs together on the same page.

A basic weblog uses just a few fields, such as entry title, entry body, and category. More complicated setups might have extended entries and keywords. Every different weblog has its own unique configuration, and weblog software should adapt accordingly. A book review post might need fields for author, publisher, ISBN, summary, review, and rating. A movie review post might include actors, IMDB links, etc. A linklog might contain fields for link destination, commentary, and attributed site. A blogrol could contain a person’s name, site name, site URL, one-line bio, XFN data, and FOAF link. The config screen for each of my weblogs should let me define and name fields specific to that weblog, and create a template tag for that field, like <$MTCustomFieldISBN$> or <$MTCustomFieldvialink$>.

Pages Containing Multiple Weblogs

While it makes sense to put different types of posts into different weblogs, there’s no easy way to have all of those posts appear interspersed together in chronological order on my main page. Currently, MovableType assumes that the weblog is the basic building block of a page. TypePad allows extra stuff like TypeLists and photo albums to hang out on a page’s sidebar (and really, TypeLists are just stripped-down weblogs without archives, comment systems, or XML feeds), but doesn’t let you integrate this information in with full-fledged posts. Suppose I wanted to keep a moblog but wanted its photos to show up inline with my text posts. What I see is a move away from weblog-centered pages to pages whose content can include posts from any local source. Archives could be similarly organized and both integrated and segregated, so that users could view everything posted in a April 2003, or just photos from that month, or just posts in the “Romance” category whether they’re books or movies.

RSS and Atom fields should be available for all posts within a single weblog and for all posts on the entire page.

Built-In Text Education and Validation

Daring Fireball’s SmartyPants is great. It and Amputator should be built into MovableType and be turned on by default. Encoding ampersands would solve validation problems for most pages. Furthermore, though templates can be easily coded to output valid HTML, a page is only valid if the content of its posts are valid as well. There should be an option to “validate and publish” that will return markup errors before posting an entry if any are found. [Note: a per a strand from Daring Fireball, a post cannot actually be valid on invalid, just well-formed or not. Still MT could check so make sure start tags have end tags and such.]

Cruft-Free URLs

MovableType should automatically generate cruft-free URLs.

Spam Protection

All email address should be automatically hidden from spambots using an approach similar to (or licensed from) The Hiveware Enkoder.

Link Stripping

Comment spam is a problem. Instead of blacklisting IP addresses, we should blacklist link destinations. Links to known porn sites in comments should either be banned or stripped down to plain text.

09 October 2003

Multiple Column Layout Using MT Tags

The layout of newspapers and magazines has developed into an elegant art. Web design lags behind. One of the staples of print design that the web hasn’t gotten right yet is multiple column layout. XHTML and CSS have (so far) no way to make an article automatically spill over into a second or third column.

I think, and I haven’t tested or templated this, that MovableType tags, along with a few junk divs, can be used to make a post flow into columns.

The idea, and please send me a TrackBack if you have any success, is to use trim_to and offset in your <$MTEntryBody$> to cut up each column to the same length and use multiple divs to place them where you want them.

(500 characters below is a complete guess at column length.) Something like:

<div class="col1"><$MTEntryBody trim_to="500"$></div> <div class="col2"><$MTEntryBody trim_to="500" offset="501"$></div> <div class="col2"><$MTEntryBody trim_to="500" offset="1001"$></div> 

I’m not entirely sure that offset works like this, but if not someone could probably write a plug-in. Even better, someone could write a plug-in that counts the character or word number of an entry, divides it by three, and uses that for the trim_to.

Just an idea.

24 September 2003

Redirecting Your MovableType Permalinks to TypePad

I use TypePad for my weblog. I used to use MovableType for my weblog. I’ve since imported all my old entries into the new page and, thanks to good engineering by the Six Apart team, everything got from one place to another perfectly with all the data intact.

One of the big problems that one can have when moving to a new site is that all of the link locations change. If anyone’s bookmarked an old entry, they might never find its twin on the new site. And until search engines find the new version, new people might stumble across the old one without knowing any better.

Here are two tricks I’ve used to make the transition better.

First, add/change to a “noindex, follow” meta in your head. This will tell search engines to ignore the old page and direct them to the new one. Now, set up a redirect from the old page to the TypePad permalink. You’ll want to give the user a few seconds so that they don’t get confused, and provide a bit of text telling them to note the new location and to change their bookmarks. Here’s a basic template (click to enlarge):

<!DOCTYPE html PUBLIC "-//W#C/DTD XML 1.0 Transitional//EN "http://www.w3.org/TR/xhtml1/ DTD/xhtml1-transitional.dtd">  <html xlmns="http://www.w3.org/1999/xhtml"> <head> <title>redirecting to TypePad</title> <meta http-equiv="Content-Type" content=" text/html; charset=iso-8859-1" /> <meta http-equiv="REFRESH" content=" 2; url="http://YourTypePadSite.typepad .com/YourTypePadSite/<$MTEntryDate format= "%Y/%m"$>/<$MTEntryTitle dirify="1" trim_to= "15"$>.html" /> </head> <body> <p>Slight address change. New address is: <a href ="http://YourTypePadSite.typepad.com/Your TypePadSite/<$MTEntryDate format="%Y/%m"$>/ <$MTEntryTitle dirift="1" trim_to="15"$>here</a></p> <p>Redirecting...</p> </body> </html> 

You’ll have to change “YourTypePadSite” to the name of your site of course, and change typepad.com to blogs.com if that’s what you use.

The key to the redirect is in the formatting of the links. MovableType by default builds permalinks using an entry ID, while TypePad uses the year and month of an entry plus the first 15 letters of the the title. So for a September 2003 post called “My First Post,” the permalink will be: http://example.typepad.com/example/ 2003/09/myfirstpost.html The template uses MT tags to reformat that data into the proper URI.

Now, if people go to the old link on your page they’ll see a screen telling them that the entry has a new location followed two seconds later by a redirect to the new page on your TypePad site. I hope this helps!

Update 9/29/03: A clarification (via Everything TypePad!), this is for your Individual Archive Template.

08 August 2003

Templating MFop2

When I bought my new cell phone last month, the store had a bundle deal for an attachable camera at 50% off. Half-off is a good deal, but that would have still meant spending $50 for the camera. And while having a camera-phone would be cool, I wasn’t sure that it would be $50 cool when I already own a camera.

A few days ago I realized that eBay might be able to hook me up, so I did a quick search and, after losing my first three auction attempts, won a Communicam Mobile Camera MCA-25 for $20. I haven’t gotten it yet, but assuming that my eBay luck improves it should be here pretty soon.

In anticipation, I looked around online until I came across Mfop2, a free online service that lets you post to your website via email. And since my phone is email equipped, I can put up pictures as soon as I take them. Configuring the service wasn’t very hard and the instructions were plain and easy. I did have one problem, but an email to the developer was met with a response within hours and fixed minutes later.

I haven’t rolled the code into my main site, mainly because I don’t have the camera yet, but it’s working on the test page. In the extended entry I go through how I set up MFop2 to work with my MovableType templates.

I didn’t want to have my photos go right into the main section of my page with the rest of the entries, mainly because I don’t think the design of my page looks too good with lots of images. I’d also prefer to keep the size of the main page smaller, so loading lots of images isn’t too good of an idea. I decided that I should just put a thumbnail of the most recent picuture in the sidebar of the page along with a link to the full-sized image and accompanying text. I also wanted the header to be a link to the photo archives, and wanted links to the five most recent photos. Those links go to the individual page for each photo.

I’ve recently put most of the sidebar elements from my page into a seperate weblog called “lists” that gets imported to my main page via php includes. Information on how to do that can be found in “Movable Type tutorial — How to add a ‘sidebar’ to your blog.” With that implementation already in place, I made a new category in the sideblog called “moblog” and configured Mfop2 to post everything into it.

Next I made a new template, called “moblog” whose output is “moblog.html” and checked the “automatically rebuild” box. Here’s what the template looks like:

<MTCategories> <MTIfCategory name="Moblog"> <div class="title"><a href="<$MTCategoryArchiveLink$>"> Photos</a></div> <div class="side"> <MTEntries lastn="1"> <div class="moblog"><a href="<$MTEntryPermalink$>" title="<$MTEntryTitle$>"><$MTEntryBody$></a></div> </MTEntries> <ul class="nobullet"> <MTEntries lastn="5"> <li><a href="<$MTEntryPermalink$>" title=" <$MTEntryTitle$>"><$MTEntryTitle smarty_pants="1"$></a></li> </MTEntries> </ul> </div> </MTIfCategory> </MTCategories> 

The template uses the <MTIfCategory> tag that comes from a plug-in by Brad Choate. It lets the template output entries from only one category instead of listing them all. If you can read MT tags, the template isn’t all that complex. The first two lines tell MT to only display entries of category “moblog.” The third line makes a heading called “Photos” that is a link to the category archive for “moblog.” Next, I use to show the first entry, which will display the picture below the heading (more on this later). After this I make an unordered list which will contain the titles of the five most recent posts to the photo page. <MTEntries lastn="5"> gives me the five entries, and then each <MTEntryTitle> is an item of the list, generated by the loop.

The key to making this all come together is in my stylesheet. Since the above template is being imported into my main index, its gets styled by the CSS for the main page. I use the class “nobullet” to make my ul show up without bullets. More information on styling lists can be found at (no pun intended) A List Apart. Here’s what I use:

.nobullet    { list-style: none; padding: 0; margin: 0; } 

The most complex part comes with the .moblog style. It does three things: hides the text of the most recent post, resizes the image into a thumbnail, and styles a border around the images that changes color when moused-over. I’ve set Mfop2 to place <span> before the body of the post and </span> after it. This is because Mfop2 only puts stuff into the main entry body of MT, so it’ll have both the photo in it and the description text, but on the main page we only want to show a thumbnail of the image. Solution: we have CSS hide the text inside the span.

Mfop2 isn’t able to generate thumbnails (but claims it wll soon), so I’ve taken the unfavorable approach of setting the height and width of the images manually. I’d rather not do this, as it makes you load a large image when a small one would do, but for the moment that’s how it goes.

Here’s the style for the moblog class:

.moblog  { right: 0; margin-left: auto; } .moblog span     { display: none; } .moblog img  { border: 3px solid #2d2b5a; height: 90px; width: 120px; } .moblog img:hover   { border: 3px solid #99cc66; } .moblog a:hover  { border: none; } 

All that’s left is putting it into my index template, which is accomplished with one line of code:

<? include('http://www.davextreme.com/ davextreme/mt/lists/moblog.html'); ?> 

An important note is that the main index template for my page is now index.php instead of index.html - this seems to be required for the import method to work.

All in all Mfop2 seems to be a great service. It’s free (but I may PayPal some money in appreciation), not too hard to configure, and very customizable. Have fun enjoying my poor photographing skills!