Project

General

Profile

[script] Context Menu Search v0.3.1

Added by Mr. BS almost 10 years ago

This script is a simple example to easy lookup keywords in web services by right click menu. The sites presented in script are just examples, the idea is to user get the example as base to make your own menu.

For more info about making custom menus read the Wiki article Scripting Menus.

Screenshot:

Video demo:

<video controls>
<source src="https://www.googledrive.com/host/0B36riaEyLqg_Z294VGdSMHVtSTg&quot;>
Your browser does not support the video tag.
</video>

Video 2

Usage:

- Highlight any keyword/phrase to populate clipboard, then right click a channel blank area to use the submenu "Search for" or use the respective site alias shortcut in editbox.
- To make your own menu entries, pay attention to alias sp1/sp2 used in <keywords> query string, in most cases - if not all, replacing <space> by <+> is enough, if you prefer or some service refuses to work, use the html space encode %20.
- When adding new sites, use the syntax {key} in url, then the script will automatically inject the input. The examples are very clear, if still need help just ask.
Ps: (ALIASES) always has priority over scripts, then be sure to use unique engine keywords shortcut to take effect.

Changelog:

  • v0.3.1
    - Renamed some search engines to avoid conflict to built in commands like /ub (unban).
    - Removed Grooveshark (service discontinued) and added Twitch to example list (as if needed more :P).
    - More minor changes.
  • v0.3
    - A third parameter to $run command, if any value is specified, the script will replace dots by +. Vide HD-Torrents in example.
    - Minified a little the code, small optimizations here and there.
    - More search engines in demo list.
    - New identifier $f to return a folder unicode "icon". Check screenshots.
  • v0.2
    - Now menu is hidden if clipboard is empty.
    - Now it is a lot easier to add new sites, just use the syntax {key} where you need the keywords in url. Example: youtube.com/results?search_query={key}
    - Several optimizations and cleanup, thanks kr0n for the idea.
    - New engine to examples: Vimeo (/vm).
  • v0.1.1
    - Added editbox search engine keywords shortcuts. Example, /y <keyword> will perform a Youtube search. If no keyword parameter is provide, it will use the clipboard content or break if no plain text is available.
    - New engine to examples: Reddit (/re).
    - Now the menu also is visible for query and status windows.
    - Added alias to set the max chars limit to context menu display. Limit is not applied for the search. Default 200.
  • v0.1
    - Initial release.

Script:

; http://dev.adiirc.com/boards/5/topics/181
; Context Menu Search
; v0.3.1 by pereba

menu channel,query,status {
  -
  $iif($cb(1),Search for $qt($mid($v1,1,15) $+ $iif($len($v1) > 15, ...)))
  .AdiIRC Wiki:adi
  .Amazon:am
  .Bing:bi
  .DuckDuckGo:du
  .Ebay:e
  .Firefox Addons:f
  .$f Google
  ..Google:g
  ..Google Images:gi
  ..Google Define:gd
  ..Google Play:gp
  ..Google Shopping:gs
  .Ip Info:ipi
  .Metacritic:m
  .$f mIR $+ $chr(5607) related
  ..Hawkee:h
  ..mIR $+ $chr(5607) Forums:mirc
  .Spotify $chr(55357) $+ $chr(56571):spo
  .$f Subtitles
  ..Legendas.tv:l
  .Reddit:re
  .Start Page:spage
  .Twitter:tw
  .Urban Dictionary:urb
  .-
  .$f Torrents
  ..HD-Torrents:hdt
  ..KickassTorrents:ka
  ..Manicomio Share:ma
  ..The Pirate Bay:pi
  ..TorrentDay:td
  ..RuTracker:rut
  ..YIFY:yf
  .$f Movies Info
  ..IMDB:im
  ..Rotten Tomatoes:rt
  ..TMDb:tm
  .$f Videos
  ..Twitch:twi
  ..Youtube:y
  ..LiveLeak:ll
  ..Vimeo:vm
  -
}

alias adi $run($1-, http://dev.adiirc.com/projects/adiirc/wiki/{key})
alias am $run($1-, http://www.amazon.com/s?field-keywords={key})
alias bi $run($1-, http://www.bing.com/search?q={key})
alias du $run($1-, https://duckduckgo.com/?q={key})
alias e $run($1-, http://www.ebay.com/sch/i.html?_nkw={key})
alias f $run($1-, https://addons.mozilla.org/en-US/firefox/search?q={key}&cat=all)
alias g $run($1-, https://www.google.com/?#q={key})
alias gi $run($1-, https://www.google.com/search?tbm=isch&q={key})
alias gd $run($1-, http://www.google.com/webhp?hl=en#sclient=psy&hl=en&site=webhp&source=hp&q={key}&tbs=dfn:1)
alias gp $run($1-, https://play.google.com/store/search?q={key})
alias gs $run($1-, http://google.com/products?q={key}&btnG=Search+Products&show=dd&scoring=p)
alias groo $run($1-, http://grooveshark.com/#/search?q={key})
alias h $run($1-, http://hawkee.com/search/{key}/)
alias m $run($1-, http://www.metacritic.com/search/all/{key}/results)
alias re $run($1-, http://www.reddit.com/search?q={key})
alias spage $run($1-, https://startpage.com/do/search/?query={key})
alias tw $run($1-, https://twitter.com/search?q={key})
alias urb $run($1-, http://www.urbandictionary.com/define.php?term={key})
alias pi $run($1-, http://thepiratebay.se/search/{key}/0/99/0)
alias im $run($1-, http://www.imdb.com/find?q={key}&s=all)
alias rt $run($1-, http://www.rottentomatoes.com/search/?search={key})
alias tm $run($1-, http://www.themoviedb.org/search?query={key}, 1)
alias y $run($1-, http://www.youtube.com/results?search_query={key})
alias ll $run($1-, http://www.liveleak.com/browse?q={key})
alias vm $run($1-, http://vimeo.com/search?q={key})
alias hdt $run($1-, https://hdts.ru/torrents.php?search={key}, 1)
alias l $run($1-, http://legendas.tv/busca/{key})
alias ka $run($1-, https://kickass.to/torrents/usearch/?q={key})
alias ma $run($1-, http://www.manicomio-share.com/pesquisa.php?busca={key})
alias rut $run($1-, http://rutracker.org/forum/tracker.php?nm={key})
alias td $run($1-, http://www.torrentday.com/browse.php?#/browse.php?&search={key}&cata=yes)
alias yf $run($1-, https://yts.re/browse-movies/{key})
alias spo $run($1-, https://play.spotify.com/search/{key})
alias ipi $run($1-, http://ip-api.com/{key})

alias -l run { if (!$1) && (!$cb(1)) { return } | run $replacex($2,{key},$sp1($iif($1,$1,$cb(1)),$3))) }

; replace space by +
alias -l sp1 return $regsubex($iif($2,$plus($1),$1),/(\40)/g, $chr(43))

; folder icon
alias -l f return $chr(55357) $+ $chr(56514)

; replace dot by +
alias -l plus return $regsubex($1-,/(\.)/g, +)

; replace space by %20
alias -l sp2 return $regsubex($1-,/(\s)/g, % $+ 20)

✔ mIRC compatible.