I've been lurking/using drupal for several years. Finally made something other people may be interested in using.
googtube is a simple filter that converts urls to google and youtube videos to their embed code.
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/googtube/
It's kind of a quick hack and my first attempt at a useful regular expression. I would appreciate any comments -- especially any security concerns you might see. Thanks. As far as I can tell, it works well. I will put out a regular release after I'm more confident about it and perhaps implement a couple options.
It currently takes a url to a video on either of the two sites no mater where it's located in the filtered text -- there is no formatting involved. I like it this way, since there is nothing for the user to learn, but if you have thoughts on this let me know. Requiring the url to be on it's own line would be the next best alternative.
Keizo
Comments
This is interesting...
Is this compatible with TinyMCE?
Would love to have something like this, but I'm already committed to TinyMCE... Thanks for your work!
Albert
Esalen Alumni Group
should be
As long as TinyMCE doesn't do anything to the urls and you rearrange the order of your filters such that there are no conflicts it should be fine.
-----
personal: http://kzo.net
drupal use: http://www.ocpaddler.com
drupal 5 compatibility?
will this work with, or are there plans for a version for, drupal 5?
Do you know if this works with FCKeditor as well?
thanks,
c.
avolve designs | ethical by design
It may need some updates for
It may need some updates for 5.0, though I haven't looked into it so maybe not. I can't get to it for a little while -- I do plan to do it before I upgrade my site. If anyone gets to it sooner let me know. I've heard it works with 4.6 fine.
I don't know anything about FCKeditor, but I can't imagine any problems with it as long as the googtube filter is positioned after the html filter and before the url filter so as not to conflict with any of that. I'm assuming FCKeditor does not do anything to links before text is submitted.
Of-course like with anything, please test it yourself on a test/development site before using in production.
5 Compatibility
The Cornell Daily Sun, cornellsun.com, uses the googtube filter, and we are currently working on upgrading to Drupal 5.1. I only needed to make a few changes to make it work on 5.
First, we needed to add a googtube.info file. This is what the .info file I made looks like.
The one you make may look a bit different since you're using CVS, particularly the version line.
Also, I omitted the 'admin/module#description' case from the help hook since that's what the .info file does.
Finally, I don't know if this is new in 5 or also existed in 4.7, but the filter hook should have the following case added.
Since the filter is a static one (it's obviously not going to output something different each time you run it on the same text), this case will tell Drupal it's OK to cache the output (as long as the other filters in the input format also specify that they can be cached).
I have been using this
I have been using this module on 5.1 branch with no issues for quite some time now. Is it possible that you could create a 5.1 dev branch? or a 5.1 release?
It is not working with CCK
It is not working with CCK Content Types. Please Help
It works!
I have changed "text processing" from plain text to filtered text and it works well. :)
But filtered text put input formats fieldset when creating content, have to override it by customizing.
Thanks to Keizo Gates, author of module, for giving quick response to my msg.
Any idea?
Thanks for the effort in putting googtube up, been using it until I encountered an issue.
When a user posts a video links, it appears as a fully embed video in my shoutbox, and it just mess up the whole shoutbox and layout.
Any idea how could I disable googtube in my shoutbox?
I'm not familiar with
I'm not familiar with shoutbox, but if you can edit the text filtering for it, there's no reason you can't turn it off.
Neighborhood CCK
Neighborhood CCK might be an alternative for 5.x folks -- this module creates a field that editors may paste a URL or embed code from a provider, such as YouTube, Google Videos, or Revver (with Video Neighborhood), or Flickr (if Image Neighborhood is also enabled), and the content will display an appropriately embedded video, image, or thumbnail.
Read Neighborhood CCK Release Announcement for more information. The module is available at Neighborhood CCK.
Advomatic (Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes)
Thanks for the idea! but
Thanks for the idea! but don't be discouraged from using the googtube module, it has been working fine for me on 5.1.
Embedded Media Field
Whoops. That's been Embedded Media Field for some time now... Sorry about that...
Aaron Winborn
Advomatic (Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes)
5.x
Thanks for all the feedback and glad people didn't wait around for a 5.x update to keep using this. I just added a 5.x release so it should be available for download within the day though. No changes except for what Mike Wacker suggested. I like to keep it simple, this is all I need it to do.
-----
personal: http://kzo.net
drupal use: http://www.ocpaddler.com