Microformats Plugin

Creating and modifying plugins.
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Microformats Plugin

Post by mattsches »

Alright, guys, I made a promise some months ago, and now it's time to deliver: I've just released the first (alpha) version of my microformats plugin.

It's still full of bugs (bugs that I'm only partially aware of) and the code is quite a mess, but it's been working pretty well for quite some time on my development system, and instead of letting it sit there I thought it was time for an alpha release now :wink: I didn't find the time to polish it some more, so now I rely on you to test it, give me feedback, and motivate me to push it further.

I'm not sure if everyone knows what microformats are all about, but I'm sure some of you have heard of them as the next big thing in the social web. I'm convinced that microcontent will get bigger and bigger within the next months, so it's good that S9Y will be prepared for that, right?

So much for the introduction. You can see the plugin in action here in my blog. And you can download the plugin here. Release and installation notes are included, but I will paste part of it here anyway:
Installation Instructions:
- extract the folder 'serendipity_event_microformats' to your S9Y plugins folder
- edit serendipity_admin.php, add the following line to the html <head> and make sure you adjust the path to your installation:
<link rel="stylesheet" type="text/css" href="/plugins/serendipity_event_microformats/tabber.css"/>
- edit your templates' entries.tpl, add the following two lines where appropriate
(I added them after {$entry.body}):
{microformats_show data=$entry.properties type="hReview"}
{microformats_show data=$entry.properties type="hCalendar"}
- make sure the path to tabber-minimized.js in plugins/serendipity_event_microformats/microformatsBackend.inc.php is correct
- did I forget something?
Have fun with the plugin, and keep the feedback coming.

Regards,
- Mattsches
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

This sounds terrific. Care to give us a quick overview of how the plugin works? Do I get a microformat selector on my entry page, or is it something else?
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Sadly I am currently lacking a development environment, but I would love to test this out as soon as I have one again (hopefully this week).

This sounds VERY promising. It does sound a bit like my "communityrating" plugin in some regards. Did you have the chance to look at that one? Maybe it could be integrated somehow, or at least a common interface could be made?

In either case, I am absolutely for committing your plugin. Would you like to put it into spartacus already? As long as leaving 'Alpha' messages intact, this would be fine for the user, IMHO. And then I could also commit some code to it, if you like. What about that, do you already havea CVS account? If not, I would like to offer you one?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

judebert wrote:This sounds terrific. Care to give us a quick overview of how the plugin works? Do I get a microformat selector on my entry page, or is it something else?
Thanks, judebert. I made a few screenshots of the admin area and so on, but haven't uploaded them yet; I'll do that right after I'm home from work :wink:

There is a microformat selector on the new entry page. At the moment, there are two checkboxes, one for hReview, and the other for hCalendar. The input form remains hidden until you check one of these - the page is already long enough without ... There is one input form (a couple of inputs and selects, to be more precise) for each microformat that look very much like this and this. Actually, I borrowed some code from there, so a big thank you goes out to the guys who wrote it. Your input will then be saved to the entryproperties table.

On the frontend side, it's pretty straightforward. I created a smarty template for each of the two formats. Unfortunately, and I've become aware of this only this morning, I forgot to add the data to the feed view, but I will add that soon.

Any more questions? Go ahead ...

- Mattsches
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

garvinhicking wrote:This sounds VERY promising. It does sound a bit like my "communityrating" plugin in some regards. Did you have the chance to look at that one? Maybe it could be integrated somehow, or at least a common interface could be made?
Actually, I took your communityrating plugin as template and more or less replaced your code with mine :wink: I guess it's possible to combine the two, though I'm not quite sure if this makes sense. I'm planning to add and blend together more microformats, and thus go beyond reviews and events only. We'll have to wait and see ...
In either case, I am absolutely for committing your plugin. Would you like to put it into spartacus already? As long as leaving 'Alpha' messages intact, this would be fine for the user, IMHO. And then I could also commit some code to it, if you like. What about that, do you already havea CVS account? If not, I would like to offer you one?
CVS would be great both for the plugin and for me. And I'm totally ok with the fact of others adding to the plugin as well. I'm not sure if it's still to early to commit the code, though, but I leave that decision up to you :D

- Mattsches
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I'd prefer to add this important code at this point, because as you say: It is very promising and an important step to the future.

Do you already have CVS? If not, can you register for a SourceForge.Net user account, then I can add you if you tell me your SF-username?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Screenshots

Post by mattsches »

I've just uploaded two screenshots of the plugin in action, one shows the frontend, the other the admin area. So you guys can at least get a glimpse without having to install it. I will commit the code to the repository as soon as I find the time to concentrate on this stuff again ... right now, I'm awfully busy with other (less interesting) things :?

- Mattsches
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Neat. I like the tabs.

I assume it's possible to select neither, and then show no tabs?
Judebert
---
Website | Wishlist | PayPal
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

judebert wrote:I assume it's possible to select neither, and then show no tabs?
Exactly. If you don't want to use microformats for your entry, the input fields remain hidden. 'Cause we need the space for the ever growing list of tags :lol:
spiritquest
Regular
Posts: 24
Joined: Tue Feb 06, 2007 1:22 pm

Problems with dates and export

Post by spiritquest »

Hi,

I've managed to get the microformats working, great plugin !

The date format is showing in a strange format when I look at the entry page, also the hCalendar event does not export when using the Operator events plugin for Firefox.

It exports hCalendar events on other sites. So I am wondering if there is a problem with my site config or the plugin that you know of that I might be able to look at.

My dates are showing in this format on the entry page:

Date 1172741760 to 1172766960

Whenever I save a post in the admin area, the dates for the hCalendar tab always reset to 1970-01-01 01:33

Any help would be appreciated.

Thanks,

Ket
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Hi Ket,

great that you like the plugin. I know the date format's broken, and I got it almost fixed here on my development system. I've also added some kind of sidebar display (see my blog) for events that seems to be corretly recognized by the Operator extension (correct me if it's not). But date conversion sometimes is a bit tricky, and I got so many more ideas for this plugin, so ...

But, now that I know that people are actually using (or want to use) this plugin, I will try to release an updated version within the next 4 weeks (maybe I just need to set myself a deadline). Actually, it's running quite well on my test system now and will only need a little polishing up. So please, be patient and check back once in a while. And thanks a lot for the feedback :D

Regards
- Mattsches
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

Ok, four weeks are over. I just committed lots and lots of changes to CVS (just before midnight, phew).

Really, a lot has changed, many bugs have been squashed (hopefully), and a couple of new features have been added.

Before I go into detail, I want to point you to my documentation page that i've just set up and, therefore, is very incomplete. But I will add content over the next days.

So, the most striking new feature is that you can now display events in the sidebar. These events are marked with the hCalendar microformat stuff, so the usual extensions should recognize them. For the input I chose some kind of XML which seemed to be the easiest way.

Furthermore, time formats should be correct by now, at least if you run PHP5.

However, not every detail works the way I want it yet, and I have a huge list of new features on the back of my mind. But I wanted to release this baby now and let the feedback roll in. Overall, the experience should be quite ok, though :wink:

- Mattsches
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

After a very long while, I decided to upload an almost completely rewritten version of my microformats plugin. If you like to check it out, please download it here. PHP 5.1 is required now, and you don't have to edit your template files anymore (make sure you remove any lines with "microformats" in them if you installed an older version of the plugin).

I tested it on different setups with different templates, yet my setups are all very similar, so I rely on your help to report any bugs/showstoppers (as usual).

(New) Features:
  • Supports reviews marked up with hReview
  • Support for marking up entires with OCOinS
  • Support for marking up entries with unAPI
  • Recommended Firefox extensions to see what the plugin does ;O) : Operator, Tails Export, Zotero
I hope you like what you get. Please let me know of any bugs, recommendations, or improvements.

- Mattsches
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I love the idea of semantic content. I just wish I knew how to effectively use microformats. Should I visit each of the API pages, or is there somewhere that pulls all this information together into a newbie's overview?
Judebert
---
Website | Wishlist | PayPal
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

I admit that I am still waiting for the killer app that uses Microformats. It's all about small steps right now, I guess. OCOinS and unAPI are in use even less often. They aren't Microformats, but a different kind of semantic markup that is, to my understanding, utilized almost exclusively in library contexts. I learned about them in a session at BarCamp Berlin last year.

So maybe I should sit down over the weekend and concoct an introductionary blog post on the topic. I will try to add some sensible use cases, interspersed with some buzz words like Data Portability and Google Social Graph API :wink:

To give you a very concise example of what you could benefit from if you use hCalendar for your event announcements: With the help of the Operator extension for Firefox, your visitors can easily export an event (description, start date, end date, location, url, ...) from your blog into their calendar app.

Also, some search engine spiders can parse your blog, filter out all relevant reviews and events and display them in a central place. Google's Social Graph API does something like this with social network data that are marked up with the XFN or FOAF Microformats.

OTOH, it's just some stuff I've been interested in for quite a while, so why not create a plugin for S9y 8)

Best
- Mattsches
Post Reply