Hi all,
Kim wanted me to post this newest version of
tinyurl.xml which selects and copies the tinyurl into
the DQSD text box instead of popping up the tinyurl
webpage. Should save a few mouse clicks and
keystrokes.
Enjoy,
Brent
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
<search function="tinyurl">
<name>TinyURL</name>
<category>Functions</category>
<contributor>Brent Beardsley</contributor>
<link>http://tinyurl.com/</link>
<email></email>
<description>
TinyURL makes a short URL for your long URL so you can paste it in email messages.
<div class="helpboxDescLabels">Switches:</div>
<table class="helpboxDescTable">
<tr><td>old</td><td> - </td><td>Uses the old method of popping up the tinyurl webpage instead of setting the text area to the tinyurl</td></tr>
</table>
<div class="helpboxDescLabels">Examples:</div>
<table class="helpboxDescTable">
<tr><td>tinyurl http://wwww.reallyreallylongurltoannoyyou.com</td></tr>
<tr><td>tinyurl /o http://wwww.reallyreallylongurltoannoyyou.com</td></tr>
</table>
</description>
<form name="tinyurlf"
method="post"
action="http://tinyurl.com/create.php">
<input type="hidden" name="url" value="" />
</form>
<script><![CDATA[
function tinyurl(q)
{
if( nullArgs("tinyurl", q) )
return;
var args = parseArgs(q, "old");
var oldMode = false;
for (var i = 0; i < args.switches.length; i++) {
if (args.switches[i].name == "old") {
oldMode = true;
}
}
if (oldMode) {
document.tinyurlf.url.value = args.q;
submitForm(tinyurlf);
} else {
var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
xmlHttp.open("POST", "http://tinyurl.com/create.php?url="+args.q, false);
xmlHttp.send();
var body = xmlHttp.responseText;
var tuRegExp = new RegExp(
"<input\\s*type\\s*=\\s*('|\")?hidden('|\")?\\s*name\\s*=\\s*('|\")?tinyurl('|\")?\\s*value\\s*=\\s*('|\")?(http:\\/\\/tinyurl\\.com\\/[^\"'\\s>]*)('|\")?\\s*\\/?\\s*>"
, 'i');
var tuResult = tuRegExp.exec(body);
if ( tuResult != null && tuResult.length > 6) {
setSearchWindowText(tuResult[6], true);
} else {
setSearchWindowText("Failed to get the tinyurl...", false);
}
}
}
]]></script>
<copyright>
The following applies if this file is included and distributed with Dave's Quick Search Deskbar:
Copyright (c) 2002 David Bau; Distributed under the terms of the GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
</copyright>
</search>