K-Meleon
KMeleonWiki > Resources > MacroLibrary > KmmBitLy
Submitted by: rstlne
Notes:
Generate a short URL from a page or link using bit.ly. To invoke, use the bit.ly command in the document or link popup menus.
This macro is similar to the bookmarklet provided by bit.ly. The difference is the macro works even if you've set your bookmark options so that bookmarks open in a new layer. That setting breaks the bookmarklet.
Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file(s):
# bitly.kmm # # Macros for generating a short URL from a page or link using bit.ly. _bitly{ $OpenURL="http://bit.ly/?url=".urlencode($_bitly_url); &OpenURL_InNew; } bitly_page{ menugrayed=(hostname($URL)==""); $_bitly_url=$URL; &_bitly; } bitly_link{ $_bitly_url=$LinkURL; &_bitly; } _bitly_buildmenu{ setmenu(Document,macro,"bit.ly of page",bitly_page,-1); setmenu(LinkPopup,macro,"bit.ly of link",bitly_link,-1); setmenu(FrameLinkPopup,macro,"bit.ly of link",bitly_link,-1); } $OnInit=$OnInit."_bitly_buildmenu;"; $macroModules=$macroModules."bitly;"; # vim:set tw=0: # -- The End --