Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: DC187 on May 06, 2010, 10:31:30 AM

Title: Youtube plugin
Post by: DC187 on May 06, 2010, 10:31:30 AM
Hi all,

I've just written my first roundcube plugin which embeds youtube videos when a youtube url is found in the message body.

Forgive me but I only started using php a few days ago and so found it a challenge getting the regex to work.

At the moment it only works with plain text messages, for some reason the regex wouldn't match on html or alternative types, maybe someone with greater skills than me can shed some light on why!?

Comments and improvements much welcomed.

Cheers :)
Title: Youtube plugin
Post by: Julius Caesar on May 06, 2010, 10:43:04 AM
I haven't used it, but please don't use the
-tag. Try to use
...
Title: Youtube plugin
Post by: DC187 on May 06, 2010, 10:54:02 AM
Thanks,

I've made that change and re-attached.
Title: Youtube plugin
Post by: DC187 on May 08, 2010, 07:26:12 AM
Hi all,

I've updated this plugin which now embeds youtube video in some html messages.
Different clients write the tags differently, so far I have tested this with html format emails sent by outlook, thunderbird and roundcube webmail.

If you have a better method of doing this I would love to hear as I have to setup an array of strings to search for in order to match the html of different clients.

Feedback welcome :)

James
Title: Youtube plugin
Post by: DC187 on May 08, 2010, 07:32:36 AM
Oh it works with messages sent from gmail as well :)
Title: Youtube plugin
Post by: afrozenminute on May 13, 2010, 12:40:24 AM
Not workig :(
Title: Youtube plugin
Post by: dziobak on May 13, 2010, 01:19:13 AM
Read about adding a plugin to Roundcube. Use logs and debug, and then write something like this...
Quote from: afrozenminute;27415
Not workig :(
Title: Youtube plugin
Post by: DC187 on May 13, 2010, 01:51:35 AM
Not working doesn't really offer too many clues as to the problem.

It could be the
tag(s) haven't been matched.

To test whether the plugin is working you can send an email to yourself via roundcube with a youtube video link, it should match that.

If it works for some mail but not others I'd be interested to know what client was used to write the message and the format of the youtube URL from the original message source.

Thanks