Creating a Send-to Hook for iSpeech
I use iSpeech quite frequently http://www.ispeech.org and I was wondering if you wizards out there might be able to create a bookmarklet, script or addon for sending the clipboard or selected text to ispeech automatically http://www.ispeech.org/convert.text.php OR providing some examples of other scripts, addons, bookmarklets that have similar functionality so I can create it myself.
Usage Examples:
Select Text > Right Click > Send to iSpeech Select Text > Click Bookmarklet > Sends to iSpeech
It looks like they have an API as well http://www.ispeech.org/api
- Note: I fear I lack the necessary vocabulary to search this site for an example, so if there's something that's alread开发者_开发百科y here - please post. Please feel free to edit the tags, title and content for clarity if you understand what I'm trying to get at!
Update: I've gotten significantly closer. I think I can use the searchplugin UI built into firefox for this purpose.
Here's an example of the link:
http://www.ispeech.org/convert.text.php?type=text&voice=usenglishmale2&voiceSpeed=0&text=Enter+Text+to+Speak+Here
Now, all I should have to do is format it as a searchplugin and it should do the trick...maybe.
Close, but no cigar. There seems to be a character limit on {searchTerms} passed by the searchplugin UI.
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>iSheech</ShortName>
<Description>iSpeech Convert Text</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16"></Image>
<Url type="application/x-suggestions+json" method="GET"
template="http://www.ispeech.org/convert.text.php={searchTerms}" />
<Url type="text/html" method="GET" template="http://www.ispeech.org/convert.text.php?type=text&voice=usenglishmale2&voiceSpeed=0&={searchTerms}">
<Param name="text" value="{searchTerms}"/>
</Url>
<SearchForm>http://www.ispeech.org/convert.text.php</SearchForm>
</SearchPlugin>
Got it sorted with a bookmarklet:
javascript:q%20=%20""%20+%20(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection%20?%20document.getSelection()%20:%20document.selection.createRange().text);%20if%20(!q)%20q%20=%20prompt("You%20didn't%20select%20any%20text.%20%20Enter%20a%20search%20phrase:",%20"");%20if%20(q!=null)%20location="http://www.ispeech.org/convert.text.php?type=text&voice=usenglishmale2&voiceSpeed=0&text="%20+%20escape(q).replace(/%20/g,%20"+");%20void%200
精彩评论