Extension:Technorati
From MediaWiki.org
|
Release status: unknown |
|
|---|---|
| Implementation | Tag |
| Description | This extension allows you to put technorati tags into wiki pages. |
| License | No license specified |
| Download | see below |
|
check usage (experimental) |
|
The Technorati extension allows you to put technorati tags into your wiki pages. The hook to tag it is <tag></tag> simple as that.
<?php $wgExtensionFunctions[] = "wftechnorati"; $wgExtensionCredits['parserhook'][] = array( 'name' => 'Technorati Tags', 'description' => 'This extension allows you to put technorati tags into wiki pages.', 'url' => 'http://meta.wikimedia.org/wiki/Extention:Technorati'); function wftechnorati() { global $wgParser; $wgParser->setHook( "tag", "rendertag" ); } # The callback function for converting the input text to HTML output function rendertag( $input, $argv ) { # $argv is an array containing any arguments passed to the extension like <example argument="foo" bar>.. $output = '<!-- technorati -->'; $output .= '<a href="http://technorati.com/tag/'; $output .= htmlspecialchars( urlencode( $input ) ); $output .= '" rel="tag"></a>'; return $output; } ?>
[edit] Installation
- Go to technorati and set up your wiki to be included in their index
- Save the above as technorati.php and insert it into your extension folder
- Include it into your localsettings file
- and insert <tag></tag> into your wiki..
Right now I have it set up so that on the output page you cannot see the tags, but if you would like to view them it would be as simple as adding the following to the last $output..
$output .=$input . '</a>'; After inserting this you would need to get rid of the other </a> above it
This extension does not seem to be working in 1.6.6 at least I cannot see how technorati is picking up the tags that I have inputed.
If anyone has any ideas or a better explaination of the <tag> insertion would be greatly appreciated.
Teddyg 08:01, 12 June 2006 (UTC)
- try reading http://technorati.com/help/tags.html . user:Bawolff 07:09, 24 December 2007 (UTC)
- Previously this extention was vulnrable to XSS, so i fixed that, I also added the credit thingy. as well, technorati says to encode spaces in tagnames as +, well this was leaving them as spaces (although it seemed to work fine if encoded as %20 spaces, better to follow what they say). Note: I release all copyright on any of my changes into the public domain, yadda yadda if anyone cares. 24.65.11.65 07:04, 24 December 2007 (UTC) (n:user:Bawolff
- I'm also playing with using this in conjuction with js to turn categories into tags. plop wikinews:User:Bawolff/sandbox/cat2tag.js in your mediawiki:common.js to see it. n:user:Bawolff 07:09, 24 December 2007 (UTC)
- Previously this extention was vulnrable to XSS, so i fixed that, I also added the credit thingy. as well, technorati says to encode spaces in tagnames as +, well this was leaving them as spaces (although it seemed to work fine if encoded as %20 spaces, better to follow what they say). Note: I release all copyright on any of my changes into the public domain, yadda yadda if anyone cares. 24.65.11.65 07:04, 24 December 2007 (UTC) (n:user:Bawolff
I've changed the escaping to use a proper urlencode(). No guarantees on whether it works for anything but producing links, though. :) I'm also a bit leery of taking the tag name <tag>; that seems likely to be a naming conflict. --24.5.78.193 00:05, 1 January 2008 (UTC)