repo
string
commit
string
message
string
diff
string
JNRowe/surfraw
650ba85507cd50710a66d7562880e4b33812663d
Sourceforge search URL change Thanks Jude DaShiell for the report
diff --git a/elvi/sourceforge b/elvi/sourceforge index 451608f..e3cbdca 100755 --- a/elvi/sourceforge +++ b/elvi/sourceforge @@ -1,63 +1,63 @@ #!/bin/sh # elvis: sourceforge -- Search SourceForge (www.sourceforge.net) # $Id$ . surfraw || exit 1 # version 0.2 [email protected] 20030910 # added -exact and -type # version 0.1 # this great work has been achieved by Caiaphas Pechorin ([email protected]) w3_config_hook () { defyn SURFRAW_sourceforge_exact no def SURFRAW_sourceforge_searchtype soft } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search SourceForge (www.sourceforge.net) Local options: -exact=yes|no Require all words Default: $SURFRAW_sourceforge_exact Environment: SURFRAW_sourceforge_exact -type= soft | Software / Group people | People freshmeat Freshmeat Default: $SURFRAW_sourceforge_searchtype Environment: SURFRAW_sourceforge_searchtype EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -e*=*) setoptyn SURFRAW_sourceforge_exact $optarg ;; -e*) setoptyn SURFRAW_sourceforge_exact yes ;; -t*=*) setopt SURFRAW_sourceforge_searchtype $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://www.sourceforge.net/" else - escaped_args=`w3_url_of_arg $w3_args` - if `yesno SURFRAW_sourceforge_exact` + escaped_args=$(w3_url_of_arg $w3_args) + if $(yesno SURFRAW_sourceforge_exact) then isexact=1 else isexact=0 fi - w3_browse_url "http://sourceforge.net/search/?words=${escaped_args}&exact=$isexact&type_of_search=$SURFRAW_sourceforge_searchtype" + w3_browse_url "http://sourceforge.net/search/?words=${escaped_args}&exact=$isexact&typeofsearch=$SURFRAW_sourceforge_searchtype" fi
JNRowe/surfraw
48d3c1170c69ce0199fb52ccbe92aa47a4656238
Add STYLE guide.
diff --git a/STYLE b/STYLE new file mode 100644 index 0000000..90b1d1b --- /dev/null +++ b/STYLE @@ -0,0 +1,59 @@ + ____ _______ ___ _____ + / ___|_ _\ \ / / | | ____| + \___ \ | | \ V /| | | _| + ___) || | | | | |___| |___ + |____/ |_| |_| |_____|_____| + + + +It's important to rage against the web in _style_. Fellow surfer, +take these guidelines with you when developing revolutionary elvi: + +FOR STATEMENTS: +Prefer + for something in stuff + do + whatever + done + +over + for something in stuff ; do + whatever + done + +IF STATEMENTS: +Prefer + if rage ; + then + surf + fi + +over + if rage ; then + surf + fi + +INITIALISING VARIABLES WITH AN EMPTY STRING +The var="" syntax is preferred over var=. + +LEGIBILITY: +Revolutionary elvi are of greatest utility when they are readable. If +the consensus is that a breach of the style guide yields more readable +code, the more legible option should be chosen. + +LEADING WHITESPACE +Tabs are preferred. + +LINE LENGTH +Lines should be wrapped at 80 characters so long as it doesn't require +absurd contortions to fit this. + +LOCAL VARIABLE DECLARATION +Function variables should be defined local. What happens in the +function should stay in the function. + +PROCEESS SUBSTITUTION +Use $() over `` for legibility. + +QUICHE EATING +This is generally frowned upon.
JNRowe/surfraw
4d0660e38c328bc519a22069882570965361c225
Applied Lucas Hoffmann's whitespace fixes
diff --git a/AUTHORS b/AUTHORS index 2bab204..f25b9fe 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,168 +1,168 @@ AUTHORS Julian Assange <[email protected]> original author Christian Surchi <[email protected]> original debian maintainer elvi: debcontents, debbugs, debpackages Ian Beckwith <[email protected]> current debian maintainer elvi: alioth, bbcnews, bugzilla, deblists, freedb, imdb, scpan, codesearch, debwiki, lastfm, musicbrainz, opensearch, scholar, ctan, fsfdir, gutenberg, wayback, dmoz, w3html, w3link, w3css, w3rdf, debpts, rfc, lsm, finkpkg, rpmsearch, macports, debpkghome, debvcsbrowse, scroogle, scirus, scitopia, worldwidescience, debcodesearch, jquery, mdn, mysqldoc, pgdoc, oraclesearch, S, yacy, gmane plus various tweaks/bugfixes/features. Moritz Muehlenhoff <[email protected]> elvi: debsec, ebay, leodict, wikipedia, sharereactor, pgpkeys, happypenguin plus various patches/maintenance. Thomas Smith <[email protected]> Bugfixes, uploading. Stephen Stafford <[email protected]> Bug fixes Kevin Kreamer <[email protected]> Bug fixes Christian Weisgerber <[email protected]> elvi: fast, thesaurus, webster Jason Harris <[email protected]> elvi: freebsd, openbsd, filesearching, ftpfind Ruben Pollan <[email protected]> elvi: rae Ian Broadfoot <[email protected]> elvi: yubnub James Rowe <[email protected]> plus useful patches/maintenance. Aparna Jaitly <[email protected]> elvi: ixquick Justin B. Rye <[email protected]> elvi: cia, deblogs, etym, foldoc plus useful patches. Patroklos Argyroudis <[email protected]> elvi: discogs Simon Ernst <[email protected]> elvi: archpkg Ivy Foster <[email protected]> elvi: bookfinder, bugmenot plus various patches/maintenance Sumant Oemrawsingh <[email protected]> elvi: cliki, l1sp, mathworth, mininova, youtube plus patches, including the uzbl examples. Sadako <[email protected]> imdb fixes tczy <[email protected]> elvi: bing Simone Fittabile <[email protected]> elvi: acronym, gcache, jamendo plus patches. Micah Anderson <[email protected]> various patches René Reigel <[email protected]> elvi: aur J.R. Mauro <[email protected]> elvi: urban, piratebay, genportage Wim van Hoydonck <[email protected]> elvi: ntrs, springer, sc John Briggs <[email protected]> patch to google John Gruenenfelder <[email protected]> elvi: arxiv csh patch James TD Smith <[email protected]> elvi: javasun google country-specific options Charles Twardy <[email protected]> fixed cia Uspenskiy Andrey <[email protected]> elvi: yandex Jameson Rollins <[email protected]> elvi: ads plus tweaks. Jakob <[email protected]> elvi: pasearch Kyle Isom <[email protected]> elvi: cablesearch, duckduckgo, openports, wolfram plus various fixes/maintenance. Jason Ryan <[email protected]> elvi: archwiki, deli, github, stack, pin plus various fixes/maintenance Sara Fauzia <[email protected]> archpkg fix. Thomas Zervogiannis <[email protected]> Searchable bookmarks. Paulo Almeida <[email protected]> elvi: priberam Shain Singh <[email protected]> - elvi: cisco, f5 + elvi: cisco, f5 Manolo Martínez <[email protected]> examples: elinks integration (hooks.lua) Jon Yamokoski <[email protected]> elvi: phpdoc Lucas Hoffmann <l-m-h at web.de> elvi: commandlinefu THANKS TO Brian Nelson <[email protected]> Christian Garbs <[email protected]> Hector Blanco <[email protected]> Jeff Bailey <[email protected]> Mark W. Eichin <[email protected]> Teófilo Ruiz Suárez <[email protected]> Maru Dubshinki <[email protected]> Matt Kraai <[email protected]> Brian Mcdonald <[email protected]> Carl Fredrik Hammar <[email protected]> Andy Valencia <[email protected]> Philip Armstrong <[email protected]> Dan Jacobson <[email protected]> Sunil Nimmagadda <[email protected]> Michel <[email protected]> Nikos Apostolakis <[email protected]> Facundo Aguirre <[email protected]> Raphael Geissert <[email protected]> If we've missed anyone, let us know. diff --git a/INSTALL b/INSTALL index 0b9c940..7f59de4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,247 +1,247 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ - + Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! See README for Surfraw specific usage information Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. diff --git a/NEWS b/NEWS index 123cc61..6eac192 100644 --- a/NEWS +++ b/NEWS @@ -1,486 +1,486 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Tue Dec 10 15:49:46 GMT 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + gmane - search mailing lists + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha + yacy - search YaCy P2P search engines, including ScienceNet * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, openbsd musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or -custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Debian packaging now included in release, in debian/ dir. * Known problems at time of release + deblogs - down (hopefully) temporarily + yacy - demo portal down, ScienceNet still up + scicom - down, status unknown Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all - * Added debhelper tokens to prerm/postinst + * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: - freedb, happypenguin, jake, rhyme, scaleplus, + freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$ diff --git a/banner b/banner index 720138d..f14af48 100644 --- a/banner +++ b/banner @@ -1,15 +1,15 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ - + Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! diff --git a/debian/changelog b/debian/changelog index 11e9e70..c45b068 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,543 +1,543 @@ surfraw (2.2.9-1) unstable; urgency=low * New upstream version + yandex: Fix bashism (Closes: #690615). + rae: Fix URL (Closes: #680138). * Standards-Version: 3.9.5 (no changes). * update debian/copyright. * switch to source format 3.0 (quilt). * update Vcs-Browser fields. -- Ian Beckwith <[email protected]> Tue, 10 Dec 2013 17:03:19 +0000 surfraw (2.2.8-1) unstable; urgency=low * New upstream version + SURFRAW_graphical_remote defaults to off, as chromium doesn't support '-remote openURL()' (Closes: #628683). * Move opensearch elvi to main surfraw package. It now has an optional mode that uses a redirector if the dependencies are not installed. * debian/rules: + hardcode AWK as awk (Closes: #608967). + use dh_prep instead of dh_clean -k. + add build-arch and build-indep targets. * debian/control: + Build-Depends: bump debhelper dependency to (>= 7). + Standards-Version: 3.9.2. + surfraw-extra: convert Conflicts: to Breaks:. + surfraw: * Breaks: surfraw-extra (<= 2.2.7-1) as we have taken over /usr/lib/surfraw/opensearch. * Recommends: surfraw-extra: add version of (>> 2.2.7-1). * Tweak Description. * debian/source/format: explicitly specify 1.0 source format. -- Ian Beckwith <[email protected]> Tue, 12 Jul 2011 01:31:52 +0100 surfraw (2.2.7-1) unstable; urgency=low * New upstream version. + fixed imdb elvi (Closes: #577263). * Standards-Version: 3.8.4 (no changes). * Add ${misc:Depends} to dependencies. -- Ian Beckwith <[email protected]> Fri, 16 Apr 2010 20:43:27 +0100 surfraw (2.2.6-1) unstable; urgency=low * New upstream version. + Only use first matching bookmark (Closes: #530786). + Fix debsec (patch from Moritz Muehlenhoff) (Closes: #550741). * Remove Moritz from Uploaders (per #550741), thanks for your work!. * debian/rules: call dh_installexamples to install examples/ dir. * debian/control: + update vcs- fields to point to new git repo. + Standards-Version: 3.8.3 (No changes). + add Recommends: curl | wget | libwww-perl for -o. + Remove Conflicts/Replaces: surfaw, this transition was complete many releases ago. -- Ian Beckwith <[email protected]> Fri, 20 Nov 2009 03:34:34 +0000 surfraw (2.2.5-1) unstable; urgency=low * New upstream version. * Removed Thomas Smith from Uploaders (Closes: #519378). Thanks for your work!. * Updated my email address in Uploaders. * Fixed VCS-Browser URL (Closes: #528299). * Removed DM-Upload-Allowed header. * Standards-Version: 3.8.1 (no changes). -- Ian Beckwith <[email protected]> Wed, 13 May 2009 02:09:49 +0100 surfraw (2.2.4-1) unstable; urgency=low * New upstream version. * postrm: add 'set -e'. * debian/copyright: + Update copyright years to include 2009. + point to right GPL link (NB only the file 'missing' is GPLed, most of the package is PD). -- Ian Beckwith <[email protected]> Sun, 01 Mar 2009 02:30:59 +0000 surfraw (2.2.3-1) unstable; urgency=low * New upstream version. + Now defaults to graphical mode, see surfraw(1) for how to change it back. * Change default text browser to www-browser and default - graphical browser to sensible-browser. + graphical browser to sensible-browser. -- Ian Beckwith <[email protected]> Tue, 26 Aug 2008 22:36:24 +0100 surfraw (2.2.2-3) unstable; urgency=low * Backport slinuxdoc fix from 2.2.3 prerelease. -- Ian Beckwith <[email protected]> Fri, 25 Jul 2008 05:14:30 +0100 surfraw (2.2.2-2) unstable; urgency=medium * google: fix bashism and quote more variable expansions (Closes: #489902). Thanks to Philip Armstrong and John Briggs. * Reformat debian/copyright to keep lintian happy. -- Ian Beckwith <[email protected]> Sat, 19 Jul 2008 00:50:33 +0100 surfraw (2.2.2-1) unstable; urgency=low * New upstream version: + fix url escaping (Closes: #487430). + surfraw-update-path: fix csh support (Closes: #484871). * Recommends: Drop w3m-ssl (folded into w3m) and lynx-cur (not in lenny) (Closes: #471359). * surfraw-extra: improve long description (Closes: #471321). * Standards-Version: 3.8.0 (no changes). * Remove linda override. * Add watch file. -- Ian Beckwith <[email protected]> Thu, 03 Jul 2008 01:22:36 +0100 surfraw (2.2.1-2) unstable; urgency=low * Remove my old email address from Uploaders. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:35 +0000 surfraw (2.2.1-1) unstable; urgency=low * New upstream release. + bashisms removed (Closes: #465361, #468139). * debian/rules: move .deb building to binary-indep: target. * debian/compat: bump to 6. * debian/control: + DM-Upload-Allowed: yes merged from Debian-only 2.1.7-1 (see below). Dropped XS- prefix, no longer needed. + Recommends: add elinks | elinks-lite to existing browser alternatives. + Uploaders: update my email address. + Standards-Version: 3.7.3 (no changes). + Build-Depends: Bump debhelper version to >= 6. + Vcs-Cvs/Vcs-Browser: remove XS- prefix and -d workaround. + Homepage: added. * debian/changelog: merged Moritz's debian-only 2.1.7 release changelog. * debian/linda.overrides: remove exec-not-elf-or-script tag now file(1) is fixed. * debian/copyright: update, use machine-interpretable format. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:08 +0000 surfraw (2.2.0-1) UNRELEASED; urgency=low * Actual first new upstream release. See changelog.gz for upstream changes, like a normal package. * debian/rules: Use $(CURDIR) instead of `pwd`. * debian/copyright: updated copyright dates. -- Ian Beckwith <[email protected]> Tue, 11 Sep 2007 03:41:09 +0100 surfraw (2.1.8-1) UNRELEASED; urgency=low * First proper upstream release of the surfraw-devel version. After this release non-debian changes will be logged in the upstream changelog.gz. * Split off opensearch into new package: surfraw-extra as it has a huge dependency tree that not everyone will want to install. * Fixed "sr -options bookmark" (excessive quoting). * New elvi: + archpkg - search Arch Linux packages. Thanks to Simon Ernst. + port - look up a TCP/UDP port on seifried.org/security/ports. * Fixed elvi + debbugs: fixed help formatting. + debcontents - new options * Fixed tests: + austlii - (since when does a legal db not contain "tort"?). + deblists - -security-announce not indexed (#440347), so we search for WNPP posts on -devel. + debpackages. + sunsolve - added cookie to accept license. + w3html - validator will not validate itself. * runtests (see test/README): + Added cookie support. + Added support for skipping tests with SKIP. + Abort if libwww-perl not installed. + Documented changes in test/README. * Makefile.am: removed debian/ files from EXTRA_DIST, they should be in the debian patch not the main tarball. * Bumped debhelper compat level to 5. * Really updated to automake-1.10. * Updated AUTHORS, NEWS, README, HACKING, ChangeLog, NEWS.Debian. -- Ian Beckwith <[email protected]> Fri, 07 Sep 2007 00:18:38 +0100 surfraw (2.1.7) unstable; urgency=low * Add "XS-DM-Upload-Allowed: yes", so that Ian can upload further updates on his own. -- Moritz Muehlenhoff <[email protected]> Sun, 13 Jan 2008 23:23:30 +0100 surfraw (2.1.6) unstable; urgency=low * New elvi: + codesearch - search google code search. + debwiki - search wiki.debian.org and women.debian.org/wiki. + lastfm - search last.fm. + musicbrainz - search musicbrainz.org. + opensearch - search sites that provide an OpenSearch description: - Install helper scripts opensearch-discover and opensearch-genquery to /usr/bin. - Add Dependencies on libwww-opensearch-perl, libwww-perl and libhtml-parser-perl. - Makefile.am: replaced explicit rule for surfraw-update-path.1 with a static pattern rule for making man pages from perl scripts. * Fixed elvi: + amazon - fixed example usage. + cia - switched to https. + cite - fixed URL and options. + debpackages - updated ubuntu distro names. + debcontents - updated ubuntu distro names. + freebsd - fixed help formatting. + netbsd - fixed mailing list searches. + openbsd - fixed PR search URL. + slinuxdoc - fixed URLs. + sundocs - fixed URLs. + woffle - updated URLs to match woffle 2.9a. * Removed elvi: jake - site shut down January 2007. * Implemented test suite - 'make test' or see test/README. * Fixed make distcheck. * Updated to automake 1.10. * debian/rules: stopped ignoring return code of 'make distclean'. * Updated Copyright dates to 2007. * Add Vcs-Cvs and Vcs-Browser fields to debian/control. -- Ian Beckwith <[email protected]> Sat, 30 Jun 2007 22:15:14 +0100 surfraw (2.1.5) unstable; urgency=low * Added myself to Uploaders. * Ack not-really-NMU (Closes: #354737). * Applied bash completion fixes, thanks to Justin B. Rye (Closes: #361668). * wikipedia: disable requoting; use Go rather than Search. * Fixes to ixquick elvi, thanks to Aparna Jaitly. * debpackages/debcontents: new options + ubuntu support with -u. * New elvi: scholar - search google scholar. * New elvi: discogs, thanks to Patroklos Argyroudis. * Thanks to James Rowe for the following patches: + Move W to /usr/lib/surfraw (see http://bugs.gentoo.org/show_bug.cgi?id=58955). + New elvi: genpkg for Gentoo package search. + Generate elvi list on demand and eliminate surfraw_elvi.list + Make elvidir configurable. + Make sysconfdir configurable. + Fix 'make dist' and 'make distcheck'. + Remove unused browser checks. + Drop AC_CANONICAL_HOST - not needed. * New global option: -p / -print: just print search url. * Remove config.guess and config.sub - not needed. * Remove config.{guess,sub} updating logic from debian/rules. * postrm: remove /etc/surfraw_elvi.list if it exists. * Convert debhelper Build-Depends-Indep: to Build-Depends:. * Standards-Version: 3.7.2 (No changes). * Updated Copyright dates to 2006. * Added linda override exec-not-elf-or-script for /usr/bin/surfraw due to erroneous file(1) output (See: #369977). * Tweak HACKING appendix 1 to remove need to build surfraw_elvi.list. -- Ian Beckwith <[email protected]> Tue, 26 Sep 2006 04:22:53 +0100 surfraw (2.1.4) unstable; urgency=low * Ian Beckwith <[email protected]>: + changed elvi: - debsec: fix tabbing (Closes: #354737). - debbugs: updated search options. + new elvi: - ixquick (Thanks to Aparna Jaitly). - ctan. - fsfdir. - gutenberg. - wayback. + Makefile.include: changed sed invocation to work with both old and new make(1). + debian/rules install: removed spurious mkdir. + removed debian/{prerm,postinst}. + Switched to debhelper compat level 4. + HACKING: corrected appendix 1. -- Ian Beckwith <[email protected]> Fri, 17 Mar 2006 22:26:37 +0000 surfraw (2.1.3) unstable; urgency=high * Urgency high, as it renders surfraw uninstallable * Really, really remove debconfage (Closes: #354263) -- Moritz Muehlenhoff <[email protected]> Fri, 24 Feb 2006 23:00:09 +0100 surfraw (2.1.2) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Fix FTBFS due to make changes (Patch by Matt Kraai) (Closes: 353314) + Fix zsh completion for yubnub (Patch by Micah Anderson) (Closes: #341872) + Remove debian/po to prevent further translations in vain. Sorry for the wasted work on the Swedish translation, Daniel Nylander! (Closes: #338149, #336687) + Changed maintainer address to "Debian surfraw maintainers", added Christian, Thomas and myself to uploaders + New elvis: debsec (for the Debian security tracker) -- Moritz Muehlenhoff <[email protected]> Thu, 23 Feb 2006 16:49:55 +0100 surfraw (2.1.1) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Removed debconf information about new elvi structure, now that Sarge has been released with it. Moved it to README.Debian. (Closes: #313852, #312979, #319841, #319842) - + New elvis: yubnub (by Iain D Broadfoot) (Closes: #315188) + + New elvis: yubnub (by Iain D Broadfoot) (Closes: #315188) + Removed unused SURFRAW_p0rn option (Closes: #324166) + Bumped standards version (no changes required) + Change to a native package, most of the elvis are now more or less Debian specific anyway - + -- Moritz Muehlenhoff <[email protected]> Fri, 29 Apr 2005 16:20:39 +0200 surfraw (2.1.0-1) unstable; urgency=medium * Ian Beckwith <[email protected]>: + New elvi: dmoz, w3html, w3link, w3css, w3rdf. + New elvi: rae (by Ruben Pollan <[email protected]>). + surfraw.IN:w3_url_escape: escaped `(' and `)'. + Fixed elvi (Thanks to Justin B. Rye): - sunsolve (Closes: #289502). - altavista (Closes: #289503). + deblists: Updated list of debian mailing lists. + currency: Now a proper elvis. + Added appendix 2 to HACKING on preparing a release. * Moritz Muehlenhoff <[email protected]>: + Switch rhymes search from Lycos to Rhymezone (by Justin B Rye) (Closes: #289498) + Fix BBC News search (by Justin B Rye) (Closes: #289499) + New elvi by by Justin B Rye (Closes: #290032) - cia Search for CIA documents - deblogs Debian changelogs - etym Search for word origins - foldoc Free online dictionary of computing + New cve elvis for CAN assignment searches + Rewrite debian/copyright properly -- Thomas Smith <[email protected]> Wed, 20 Apr 2005 17:00:59 -0500 surfraw (2.0.2-2) unstable; urgency=low * Applied Brian Mcdonald's workaround for bash bug (Closes: #269982) -- Christian Surchi <[email protected]> Mon, 13 Sep 2004 16:34:53 +0100 surfraw (2.0.2-1) unstable; urgency=low * Several patches from Justin B Rye: + Add bash completion (Closes: #240629) + Add some missing elvis in surfraw_elvi.list (Closes: #241079) + Don't set DISPLAY when in text-only mode (Closes: #235251) + Correctly test for text-mode in w3_browse_url() + Readability improvements + Use argv[0] instead of computing it through basename * Removed elvi: + sharereactor: has been closed down * Added French debconf template by Christian Perrier (Closes: #236088) * Added German debconf template by Helge Kreutzmann (Closes: #253800) * New elvi: debpts. * man page hyphenation fixes. * debian/control: + Dropped optional last part of Standards-Version. + Changed lynx to lynx-cur in Recommends to avoid confusing apt. + Added po-debconf to Build-Depends-Indep. * debian/rules clean: + enabled config.{guess,sub} update. + remove templates.merged. * HACKING: updated Appendix 1. * surfraw.conf.in: set SURFRAW_graphical_browser to x-www-browser (Closes: #256201) -- Ian Beckwith <[email protected]> Thu, 29 Jul 2004 15:31:10 +0100 surfraw (2.0.1-1) unstable; urgency=low * Moved elvi to /usr/lib/surfraw (Closes: #230276) * Updated docs for new elvi location * Changed man page section for all elvi to 1sr (Closes: #230056) * Fixed surfraw help text (Closes: #230109) * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all - * Added debhelper tokens to prerm/postinst + * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Updated README with text from new man page. * Added "Copyright (c) 2003, 2004 The Surfraw-Devel Team <[email protected]>" to the list of copyright holders. - * Fixed quoting so sr google foo "bar baz" qux works + * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again. * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them (Closes: #231939). * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * Added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. - * Disabled ifs quoting in elvi that don't like it: + * Disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * Synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf -- Ian Beckwith <[email protected]> Tue, 10 Feb 2004 03:33:14 +0000 surfraw (2.0-1) unstable; urgency=low * Ack NMUs. (Closes: #200164, #201229, #209155, #113148, #119357, #131661) * ..and.. (Closes: #149584, #156466, #141243, #154304, #164206, #141242) * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and ebay, pgpkeys and sharereactor, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Closing non-bugs: - Complaint about correct behaviour (Closes: #173714). - Adds functionality already present in debcontents (Closes: #144080). - Obsoleted by sensible-browser (imho) (Closes: #155423). - + -- Ian Beckwith <[email protected]> Sun, 9 Nov 2003 22:02:44 +0000 surfraw (1.0.7-3) unstable; urgency=low * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. -- Thomas Smith <[email protected]> Thu, 4 Sep 2003 18:09:29 -0500 surfraw (1.0.7-2) unstable; urgency=low * The first "collaborative" release :) * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* -- Christian Surchi <[email protected]> Sat, 16 Aug 2003 17:02:03 +0000 surfraw (1.0.7-1) unstable; urgency=low - * New upstream release + * New upstream release * New debian/rules with DH_COMPAT=3 too * Elvi: linuxdoc renamed to slinuxdoc translate renamed to stranslate * Removed unuseful scripts in debian directory * Removed emacs settings in changelog - + -- Christian Surchi <[email protected]> Sat, 2 Mar 2002 23:54:34 +0100 surfraw (1.0.4-1) unstable; urgency=low * New upstream release, surfraw becomes public domain * Support "--" option to end all options (Closes:#113429) * Added elvi for Debian bugs search (Closes:#70109) * Fixed typo (Closes:#100431) * Removed elvi: ircsearch, newscientist (Closes:#113004,#80099) -- Christian Surchi <[email protected]> Thu, 25 Oct 2001 06:56:17 -0400 surfraw (1.0.2-2) unstable; urgency=low * linuxdoc renamed to linuxdoc.surfraw (Closes: #78994) * surfraw-translate renamed to translate.surfraw -- Christian Surchi <[email protected]> Thu, 21 Dec 2000 10:54:45 -0500 surfraw (1.0.2-1) unstable; urgency=low * New upstream release * New and patched elvi (Closes:#70110) -- Christian Surchi <[email protected]> Tue, 3 Oct 2000 15:49:08 +0200 surfraw (0.5.5-1) unstable; urgency=low * Initial Release. -- Christian Surchi <[email protected]> Sat, 5 Aug 2000 16:56:47 +0200 diff --git a/debian/copyright b/debian/copyright index a986c63..fbe1db2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,83 +1,83 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: surfraw Upstream-Contact: Surfraw-Devel <[email protected]> Source: http://surfraw.alioth.debian.org/dist/ Comment: This package has initially been debianized by Christian Surchi - <[email protected]> since Sat, 5 Aug 2000 18:59:30 +0200. + <[email protected]> since Sat, 5 Aug 2000 18:59:30 +0200. . surfraw has originally been developed by Julian Assange <[email protected]>, and was originally downloaded from ftp://ftp.netbsd.org/pub/NetBSD/misc/proff/ . Since July 2003 its development has continued through the surfraw Alioth project, you're welcome to contribute. Files: * Copyright: Copyright (c) 2003-2013 The Surfraw-Devel team Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study License: PD The copyright holders listed above assert no rights on this release of the software ``surfraw'' and thereby explicity place this release into the public domain. Do what you will. Files: missing Copyright: © 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. License: GPL-2+ | other As a special exception to the GNU General Public License, if you distribute this file as part of a program that contains a configuration script generated by Autoconf, you may include it under the same distribution terms that you use for the rest of that program. . On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2' Files: INSTALL Copyright: © 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. License: other This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Files: mkinstalldirs Copyright: Author: Noah Friedman <[email protected]> License: PD # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman <[email protected]> # Created: 1993-05-16 # Public domain Files: install-sh Copyright: © 1994 X Consortium License: other Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. . Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from the X Consor- tium. . FSF changes to this file are in the public domain. Files: Makefile.in */Makefile.in -Copyright: © 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +Copyright: © 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. License: other This Makefile.in is free software; the Free Software Foundation gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. diff --git a/debian/rules b/debian/rules index e443901..7f49074 100755 --- a/debian/rules +++ b/debian/rules @@ -1,88 +1,88 @@ #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr -sysconfdir=/etc --mandir=\$${prefix}/share/man --with-text-browser=www-browser --with-graphical-browser=sensible-browser AWK=awk touch configure-stamp build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp -build-stamp: configure-stamp +build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) distclean dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs # Add here commands to install the package into debian/surfraw. $(MAKE) install DESTDIR=$(CURDIR)/debian/surfraw/ # Build architecture-dependent files here. binary-arch: build install # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot mkdir debian/surfraw/etc/bash_completion.d/ install -m 644 surfraw-bash-completion debian/surfraw/etc/bash_completion.d/surfraw dh_installdocs dh_installchangelogs ChangeLog dh_installexamples examples/README examples/uzbl_load_url_from_surfraw # copy shared doc files dh_install --sourcedir=debian/surfraw -psurfraw-extra # move files that are in surfraw-extra dh_movefiles --sourcedir=debian/surfraw -psurfraw-extra dh_link dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure diff --git a/elvi/acronym b/elvi/acronym index 56199ce..04d719a 100755 --- a/elvi/acronym +++ b/elvi/acronym @@ -1,168 +1,168 @@ #!/bin/sh # $Id$ # elvis: acronym -- Look for acronyms definitions (www.acronymfinder.com) . surfraw || exit 1 w3_config_hook () { defyn SURFRAW_acronym_ict 0 defyn SURFRAW_acronym_sci 0 defyn SURFRAW_acronym_gov 0 defyn SURFRAW_acronym_org 0 defyn SURFRAW_acronym_biz 0 defyn SURFRAW_acronym_pop 0 defyn SURFRAW_acronym_exa 1 defyn SURFRAW_acronym_wim 0 defyn SURFRAW_acronym_zip 0 defyn SURFRAW_acronym_ran 0 defyn SURFRAW_acronym_gen 0 defyn SURFRAW_acronym_alpha 0 defyn SURFRAW_acronym_attic 0 - def SURFRAW_acronym_path + def SURFRAW_acronym_path def SURFRAW_acronym_par } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [option] [keyword] Description: Surfraw searches for possible definitions of acronyms using acronymfinder.com Local option: -i -ict List all acronyms matching in Information Technology category -s -sci List all acronyms matching in Science & Medicine category -g -gov List all acronyms matching in Government & Military category -o -org List all acronyms matching in Organizations & Schools category -b -biz List all acronyms matching in Business & Finance category -c -common List all acronyms matching in Slang & Pop Culture category -e -exact List all acronyms matching with exact match (Default when keyword specified) -w -wim List all acronyms matching with Word(s) in meaning match -z -zip List all acronyms matching with Location (postal code, name) match -r -random List a random acronym (Default when no keyword specified) -f -fake List a fake acronym generated with the Acronym Finder Random Systematic Buzz Phrase Projector (AFRSBPP) -a -alphabetic List all acronyms matching sorted alphabetically instead of by rank -u -unverified List all acronyms matching, included those unverified by men and potentially misleading (Acronym Attic) EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in #Information Technology category -i*) setoptyn SURFRAW_acronym_ict 1 setoptyn SURFRAW_acronym_sci 0 setoptyn SURFRAW_acronym_gov 0 setoptyn SURFRAW_acronym_org 0 setoptyn SURFRAW_acronym_biz 0 setoptyn SURFRAW_acronym_pop 0 ;; #Science & Medicine category -s*) setoptyn SURFRAW_acronym_sci 1 setoptyn SURFRAW_acronym_ict 0 setoptyn SURFRAW_acronym_gov 0 setoptyn SURFRAW_acronym_org 0 setoptyn SURFRAW_acronym_biz 0 setoptyn SURFRAW_acronym_pop 0 ;; #Government & Military category -g*) setoptyn SURFRAW_acronym_gov 1 setoptyn SURFRAW_acronym_sci 0 setoptyn SURFRAW_acronym_ict 0 setoptyn SURFRAW_acronym_org 0 setoptyn SURFRAW_acronym_biz 0 setoptyn SURFRAW_acronym_pop 0 ;; #Organizations & Schools category -o*) setoptyn SURFRAW_acronym_org 1 setoptyn SURFRAW_acronym_sci 0 setoptyn SURFRAW_acronym_gov 0 setoptyn SURFRAW_acronym_ict 0 setoptyn SURFRAW_acronym_biz 0 setoptyn SURFRAW_acronym_pop 0 ;; #Business & Finance category -b*) setoptyn SURFRAW_acronym_biz 1 setoptyn SURFRAW_acronym_sci 0 setoptyn SURFRAW_acronym_gov 0 setoptyn SURFRAW_acronym_org 0 setoptyn SURFRAW_acronym_ict 0 setoptyn SURFRAW_acronym_pop 0 ;; #Slang & Pop Culture category -c*) setoptyn SURFRAW_acronym_pop 1 setoptyn SURFRAW_acronym_sci 0 setoptyn SURFRAW_acronym_gov 0 setoptyn SURFRAW_acronym_org 0 setoptyn SURFRAW_acronym_biz 0 setoptyn SURFRAW_acronym_ict 0 ;; #exact match -e*) setoptyn SURFRAW_acronym_exa 1 setoptyn SURFRAW_acronym_wim 0 setoptyn SURFRAW_acronym_zip 0 ;; #Word(s) in meaning match - -w*) setoptyn SURFRAW_acronym_wim 1 - setoptyn SURFRAW_acronym_exa 0 + -w*) setoptyn SURFRAW_acronym_wim 1 + setoptyn SURFRAW_acronym_exa 0 setoptyn SURFRAW_acronym_zip 0 ;; #Location (postal code, name) match -z*) setoptyn SURFRAW_acronym_zip 1 setoptyn SURFRAW_acronym_wim 0 setoptyn SURFRAW_acronym_exa 0 ;; #Random acronym -r*) setoptyn SURFRAW_acronym_ran 1 setoptyn SURFRAW_acronym_gen 0 ;; #Fake acronym -f*) setoptyn SURFRAW_acronym_gen 1 setoptyn SURFRAW_acronym_ran 0 ;; #Sort alphabetically -a*) setoptyn SURFRAW_acronym_alpha 1 ;; #Match from Acronym Attic -u*) setoptyn SURFRAW_acronym_attic 1 ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then if [ "$SURFRAW_acronym_gen" = 1 ]; then SURFRAW_acronym_path="http://www.acronymfinder.com/buzzgen.asp" # Fake Acronym else SURFRAW_acronym_path="http://www.acronymfinder.com/random.aspx" # Random Acronym fi else escaped_args=`w3_url_of_arg $w3_args` if [ "$SURFRAW_acronym_attic" = 1 ]; then SURFRAW_acronym_path="http://www.acronymattic.com/~/search/aa.aspx?Acronym=" # Acronym Attic else SURFRAW_acronym_path="http://www.acronymfinder.com/~/search/af.aspx?Acronym=" # Acronym Finder if [ "$SURFRAW_acronym_exa" = 1 ]; then par="exact" elif [ "$SURFRAW_acronym_wim" = 1 ]; then par="on" elif [ "$SURFRAW_acronym_zip" = 1 ]; then par="zip" fi SURFRAW_acronym_par="&Find=find&string=$par&Page=1" if [ "$SURFRAW_acronym_ict" = 1 ]; then par="IT" elif [ "$SURFRAW_acronym_sci" = 1 ]; then par="SciMed" elif [ "$SURFRAW_acronym_gov" = 1 ]; then par="MilGov" elif [ "$SURFRAW_acronym_org" = 1 ]; then par="Org" elif [ "$SURFRAW_acronym_biz" = 1 ]; then par="Business" elif [ "$SURFRAW_acronym_pop" = 1 ]; then par="Slang" - fi + fi SURFRAW_acronym_par="$SURFRAW_acronym_par&Category=$par" fi if [ "$SURFRAW_acronym_alpha" = 1 ]; then SURFRAW_acronym_par="$SURFRAW_acronym_par&s=a" fi fi w3_browse_url "$SURFRAW_acronym_path${escaped_args}$SURFRAW_acronym_par" diff --git a/elvi/cnn b/elvi/cnn index 1c316ce..6b25ef1 100755 --- a/elvi/cnn +++ b/elvi/cnn @@ -1,25 +1,25 @@ #!/bin/sh # $Id$ # elvis: cnn -- Search on CNN (cnn.com) # version 0.1 by Ross Campbell [email protected] -# version 0.2 updated url +# version 0.2 updated url . surfraw || exit 1 w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search on CNN (search.cnn.com) EOF w3_global_usage } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://cnn.com/" else escaped_args=`w3_url_of_arg $w3_args` w3_browse_url "http://www.cnn.com/search/?query=${escaped_args}&x=0&y=0&primaryType=mixed" fi diff --git a/elvi/currency b/elvi/currency index e49c05a..559d22f 100755 --- a/elvi/currency +++ b/elvi/currency @@ -1,382 +1,382 @@ #!/bin/sh # $Id$ # elvis: currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) . surfraw || exit 1 list_currency_symbols () { cat <<EOT Symbol Country and Currency AFA Afghanistan, Afghani ALL Albania, Lek DZD Algeria, Dinar USD America (United States), Dollar USD American Samoa, United States Dollar EUR Andorra, Euro AOA Angola, Kwanza XCD Anguilla, East Caribbean Dollar XCD Antigua and Barbuda, East Caribbean Dollar ARS Argentina, Peso AMD Armenia, Dram AWG Aruba, Guilder AUD Ashmore and Cartier Islands, Australia Dollar AUD Australia, Dollar EUR Austria, Euro ATS Austria, Schilling [obsolete] AZM Azerbaijan, Manat EUR Azores, Euro BSD Bahamas, Dollar BHD Bahrain, Dinar BBD Bajan (Barbados), Dollar EUR Balearic Islands, Euro BDT Bangladesh, Taka BBD Barbados, Dollar BYR Belarus, Ruble EUR Belgium, Euro BEF Belgium, Franc [obsolete] BZD Belize, Dollar XOF Benin, CFA Franc BCEAO BMD Bermuda, Dollar INR Bhutan, India Rupee BTN Bhutan, Ngultrum BOB Bolivia, Boliviano ANG Bonaire, Netherlands Antilles Guilder BAM Bosnia and Herzegovina, Convertible Marka BWP Botswana, Pula BRL Brazil, Real GBP Britain (United Kingdom), Pound GBP British Indian Ocean Territory, United Kingdom Pound USD British Indian Ocean Territory, United States Dollar USD British Virgin Islands, United States Dollar BND Brunei, Dollar SGD Brunei, Singapore Dollar BGN Bulgaria, Lev XOF Burkina Faso, CFA Franc BCEAO MMK Burma (Myanmar), Kyat BIF Burundi, Franc KHR Cambodia, Riel XAF Cameroon, CFA Franc BEAC CAD Canada, Dollar EUR Canary Islands, Euro CVE Cape Verde, Escudo KYD Cayman Islands, Dollar XAF Central African Republic, CFA Franc BEAC XAF CFA Communauté Financière Africaine BEAC Franc XOF CFA Communauté Financière Africaine BCEAO Franc XAF Chad, CFA Franc BEAC CLP Chile, Peso CNY China, Yuan Renminbi AUD Christmas Island, Australia Dollar AUD Cocos (Keeling Islands, Australia Dollar COP Colombia, Peso XAF Communauté Financière Africaine BEAC Franc XOF Communauté Financière Africaine BCEAO Franc KMF Comoros, Franc XPF Comptoirs Français du Pacifique Franc XAF Congo/Brazzaville, CFA Franc BEAC CDF Congo/Kinshasa, Franc NZD Cook Islands, New Zealand Dollar AUD Coral Sea Islands, Australia Dollar CRC Costa Rica, Colon XOF Côte d'Ivoire, CFA Franc BCEAO HRK Croatia, Kuna CUC Cuba, Convertible Peso CUP Cuba, Peso ANG Curaço, Netherlands Antilles Guilder CYP Cyprus, Pound CZK Czech Republic, Koruna DKK Denmark, Krone DJF Djibouti, Franc XCD Dominica, East Caribbean Dollar DOP Dominican Republic, Peso EUR Dutch (Netherlands), Euro NLG Dutch (Netherlands), Guilder [obsolete] XCD East Caribbean Dollar USD East Timor, United States Dollar USD Ecuador, United States Dollar EGP Egypt, Pound SVC El Salvador, Colon GBP England (United Kingdom), Pound XAF Equatorial Guinea, CFA Franc BEAC ERN Eritrea, Nakfa EEK Estonia, Kroon ETB Ethiopia, Birr EUR Euro EUR Europa Island, Euro FKP Falkland Islands, Pound DKK Faroe Islands, Denmark Krone FJD Fiji, Dollar EUR Finland, Euro FIM Finland, Markka [obsolete] EUR France, Euro FRF France, Franc [obsolete] EUR French Guiana, Euro XPF French Polynesia, Comptoirs Français du Pacifique Franc EUR French Polynesia, Euro EUR French Southern and Antarctic Lands, Euro XAF Gabon, CFA Franc BEAC GMD Gambia, Dalasi ILS Gaza Strip, Israel New Shekel GEL Georgia, Lari DEM Germany, Deutsche Mark [obsolete] EUR Germany, Euro GHC Ghana, Cedi GIP Gibraltar, Pound XAU Gold Ounce GBP Great Britain (United Kingdom), Pound EUR Greece, Euro GRD Greece, Drachma [obsolete] DKK Greenland, Denmark Krone XCD Grenada, East Caribbean Dollar EUR Guadeloupe, Euro USD Guam, United States Dollar GTQ Guatemala, Quetzal GGP Guernsey, Pound GNF Guinea, Franc XOF Guinea-Bissau, CFA Franc BCEAO GYD Guyana, Dollar HTG Haiti, Gourde EUR Holland (Netherlands), Euro NLG Holland (Netherlands), Guilder [obsolete] EUR Holy See (Vatican City), Euro VAL Holy See (Vatican City), Lira [obsolete] HNL Honduras, Lempira HKD Hong Kong, Dollar HUF Hungary, Forint ISK Iceland, Krona INR India, Rupee IDR Indonesia, Rupiah XDR International Monetary Fund Special Drawing Right IRR Iran, Rial IQD Iraq, Dinar EUR Ireland, Euro IEP Ireland, Pound [obsolete] FKP Islas Malvinas (Falkland Islands), Pound IMP Isle of Man, Pound ILS Israel, New Shekel EUR Italy, Euro ITL Italy, Lira [obsolete] XOF Ivory Coast (Côte d'Ivoire), CFA Franc BCEAO JMD Jamaica, Dollar JPY Japan, Yen JEP Jersey, Pound USD Johnson, United States Dollar JOD Jordan, Dinar EUR Juan de Nova, Euro KZT Kazakhstan, Tenge KES Kenya, Shilling AUD Kiribati, Australia Dollar KWD Kuwait, Dinar KGS Kyrgyzstan, Som LAK Laos, Kip LVL Latvia, Lat LBP Lebanon, Pound LSL Lesotho, Loti LRD Liberia, Dollar LYD Libya, Dinar CHF Liechtenstein, Switzerland Franc LTL Lithuania, Litas EUR Luxembourg, Euro LUF Luxembourg, Franc [obsolete] MOP Macau, Pataca MKD Macedonia, Denar MGA Madagascar, Ariary MGF Madagascar, Franc [obsolete] EUR Madeira Islands, Euro MWK Malawi, Kwacha MYR Malaysia, Ringgit MVR Maldives, Rufiyaa XOF Mali, CFA Franc BCEAO MTL Malta, Lira FKP Malvinas (Falkland Islands), Pound USD Marshall Islands, United States Dollar EUR Martinique, Euro MRO Mauritania, Ouguiya MUR Mauritius, Rupee EUR Mayotte, Euro MXN Mexico, Peso USD Micronesia, United States Dollar USD Midway Islands, United States Dollar MDL Moldova, Leu EUR Monaco, Euro MNT Mongolia, Tughrik EUR Montenegro, Euro XCD Montserrat, East Caribbean Dollar MAD Morocco, Dirham MZM Mozambique, Metical MMK Myanmar (Burma), Kyat NAD Namibia, Dollar AUD Nauru, Australia Dollar HTG Navassa, Haiti Gourde USD Navassa, United States Dollar CNY Nepal, China Yuan Renminbi NPR Nepal, Rupee ANG Netherlands Antilles, Guilder EUR Netherlands, Euro NLG Netherlands, Guilder [obsolete] XPF New Caledonia, Comptoirs Français du Pacifique Franc NZD New Zealand, Dollar NIO Nicaragua, Cordoba XOF Niger, CFA Franc BCEAO NGN Nigeria, Naira NZD Niue, New Zealand Dollar AUD Norfolk Island, Australia Dollar KPW North Korea, Won USD Northern Mariana Islands, United States Dollar NOK Norway, Krone OMR Oman, Rial PKR Pakistan, Rupee USD Palau, United States Dollar XPD Palladium Ounce PAB Panama, Balboa USD Panama, United States Dollar PGK Papua New Guinea, Kina CNY Paracel Islands, China Yuan Renminbi VND Paracel Islands, Vietnam Dong PYG Paraguay, Guarani PEN Peru, Nuevo Sol PHP Philippines, Peso NZD Pitcairn, New Zealand Dollar XPT Platinum Ounce PLN Poland, Zloty EUR Portugal, Euro PTE Portugal, Escudo [obsolete] USD Puerto Rico, United States Dollar QAR Qatar, Riyal EUR Reunion, Euro ROL Romania, Leu RUB Russia, Ruble RWF Rwanda, Franc ANG Saba, Netherlands Antilles Guilder SHP Saint Helena, Pound XCD Saint Kitts and Nevis, East Caribbean Dollar XCD Saint Lucia, East Caribbean Dollar EUR Saint Pierre and Miquelon, Euro XCD Saint Vincent and The Grenadines, East Caribbean Dollar EUR Saint-Martin, Euro WST Samoa, Tala EUR San Marino, Euro STD São Tome and Principe, Dobra SAR Saudi Arabia, Riyal GBP Scotland (United Kingdom), Pound SPL Seborga, Luigino XOF Senegal, CFA Franc BCEAO CSD Serbia, Dinar SCR Seychelles, Rupee SLL Sierra Leone, Leone XAG Silver Ounce SGD Singapore, Dollar ANG Sint Eustatius, Netherlands Antilles Guilder ANG Sint Maarten, Netherlands Antilles Guilder SKK Slovakia, Koruna SIT Slovenia, Tolar SBD Solomon Islands, Dollar SOS Somalia, Shilling ZAR South Africa, Rand GBP South Georgia, United Kingdom Pound KRW South Korea, Won GBP South Sandwich Islands, United Kingdom Pound EUR Spain, Euro ESP Spain, Peseta [obsolete] LKR Sri Lanka, Rupee SDD Sudan, Dinar SRD Suriname, Dollar SRG Suriname, Guilder NOK Svalbard and Jan Mayen, Norway Krone SZL Swaziland, Lilangeni ZAR Swaziland, South Africa Rand SEK Sweden, Krona CHF Switzerland, Franc SYP Syria, Pound TWD Taiwan, New Dollar TJS Tajikistan, Somoni RUB Tajikistan, Russia Ruble TZS Tanzania, Shilling THB Thailand, Baht XOF Togo, CFA Franc BCEAO NZD Tokelau, New Zealand Dollar TOP Tonga, Pa'anga MDL Transnistria, Moldova Leu TTD Trinidad and Tobago, Dollar TND Tunisia, Dinar TRY Turkey, New Lira TRL Turkey, Lira TMM Turkmenistan, Manat USD Turks and Caicos Islands, United States Dollar AUD Tuvalu, Australia Dollar TVD Tuvalu, Dollar UGX Uganda, Shilling UAH Ukraine, Hryvna AED United Arab Emirates, Dirham GBP United Kingdom, Pound USD United States, Dollar UYU Uruguay, Peso UZS Uzbekistan, Som VUV Vanuatu, Vatu EUR Vatican City, Euro VAL Vatican City, Lira [obsolete] VEB Venezuela, Bolivar VND Vietnam, Dong USD Virgin Islands, United States Dollar USD Wake Island, United States Dollar XPF Wallis and Futuna Islands, Comptoirs Français du Pacifique Franc ILS West Bank, Israel New Shekel JOD West Bank, Jordan Dinar MAD Western Sahara, Morocco Dirham WST Western Samoa (Samoa), Tala YER Yemen, Rial -ZMK Zambia, Kwacha +ZMK Zambia, Kwacha ZWD Zimbabwe, Dollar EOT } w3_config_hook () { def SURFRAW_currency_from USD def SURFRAW_currency_to EUR } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Convert currencies with the Universal Currency Converter (www.xe.net/ucc) Local options: -l List all known currency symbols. -from=SYM Symbol for currency to convert from. Default: $SURFRAW_currency_from Environment: SURFRAW_currency_from -to=SYM Symbol for currency to convert to. Default: $SURFRAW_currency_to Environment: SURFRAW_currency_to Example currency symbols: EUR (Euro), USD (US Dollars), GBP (UK Pounds), CAD (Canada Dollars), AUD (Australia Dollars), JPY (Japan Yen), INR (India Rupees), NZD (New Zealand Dollars), CHF (Switzerland Francs), ZAR (South Africa Rand) EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -from=*) setopt SURFRAW_currency_from $optarg ;; -to=*) setopt SURFRAW_currency_to $optarg ;; -l) list_currency_symbols; exit 0 ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://www.xe.net/ucc/" else escaped_args=`w3_url_of_arg $w3_args` w3_browse_url "http://www.xe.com/ucc/convert.cgi?Amount=${escaped_args}&From=${SURFRAW_currency_from}&To=${SURFRAW_currency_to}&submit=Perform+Currency+Conversion" fi diff --git a/elvi/debbugs b/elvi/debbugs index b05ed84..2a46471 100755 --- a/elvi/debbugs +++ b/elvi/debbugs @@ -1,235 +1,235 @@ #!/bin/sh # $Id$ # elvis: debbugs -- Search the debian BTS (bugs.debian.org) . surfraw || exit 1 w3_config_hook () { def SURFRAW_debbugs_search pkg def SURFRAW_debbugs_version "" def SURFRAW_debbugs_dist "" defyn SURFRAW_debbugs_archive 0 defyn SURFRAW_debbugs_merge 0 defyn SURFRAW_debbugs_statussort 1 defyn SURFRAW_debbugs_head 1 defyn SURFRAW_debbugs_foot 1 def SURFRAW_debbugs_incstatus "" def SURFRAW_debbugs_excstatus "" def SURFRAW_debbugs_incsev "" def SURFRAW_debbugs_excsev "" def SURFRAW_debbugs_inctag "" def SURFRAW_debbugs_exctag "" defyn SURFRAW_debbugs_asmbox 0 defyn SURFRAW_debbugs_headers 0 defyn SURFRAW_debbugs_boring 0 defyn SURFRAW_debbugs_revstat 0 defyn SURFRAW_debbugs_revsev 0 defyn SURFRAW_debbugs_revbugs 0 defyn setsearch 0 } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [package | bug number | maintainer email] Description: Surfraw search debian BTS (bugs.debian.org) Examples: debbugs 20000 | show report for bug #20000 debbugs [email protected] | show bugs for csurchi debbugs surfraw | show bugs for surfraw package debbugs -raw -rb surfraw | show surfraw bugs newest first Defaults if -search is not supplied: - If arg is numeric, searches by bug number, + If arg is numeric, searches by bug number, If it contains '@', searches by maintainer, Otherwise, searches by package. Local options: -search= pkg | Search type. src | bug | (bug number) maint | tag | submitter | severity | tag -s Alias for -search=src -version=VERSION Package version. -dist=oldstable | Distribution stable | proposed-updates | testing | unstable | experimental | testing-proposed-updates -arc Show archived bugs. -raw Do not sort by status or severity. -rb Reverse order of bugs shown. -rst Reverse order of statuses shown. -rse Reverse order of severities shown. -merge Display merged bugs only once. -nohead Do not show table of contents header. -nofoot Do not show statistics in the footer. -mbox View results in mbox format. * -sh Show headers. * -boring Show boring messages. * (* = only when searching by bug number.) -incstat=stat1,stat2 Include given status list. -exstat=stat3,stat4 Exclude given status list. Available statuses: open, forwarded, pending, fixed, done. -incsev=sev1,sev2 Include given severities. -exsev=sev3,sev4 Exclude given severities. Available severities: - critical, grave, serious, important, + critical, grave, serious, important, normal, minor, wishlist, fixed. -inctag=tag1,tag2 Include given tags. -extag=tag3,tag4 Exclude given tags. Available tags: potato, woody, sarge, sarge-ignore, etch, etch-ignore, sid, experimental, confirmed, d-i, fixed, fixed-in-experimental, fixed-upstream, help, l10n, moreinfo, patch, pending, security, unreproducible, upstream, wontfix, ipv6, lfs EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -s) setopt SURFRAW_debbugs_search src ; setoptyn setsearch 1 ;; -se*=*) setopt SURFRAW_debbugs_search $optarg; setoptyn setsearch 1 ;; -ve*=*) setopt SURFRAW_debbugs_version $optarg ;; -dis*=*) setopt SURFRAW_debbugs_dist $optarg ;; - -arc*) setoptyn SURFRAW_debbugs_archive 1;; - -mer*) setoptyn SURFRAW_debbugs_merge 1;; - -raw*) setoptyn SURFRAW_debbugs_statussort 0;; - -noh*) setoptyn SURFRAW_debbugs_head 0;; - -nof*) setoptyn SURFRAW_debbugs_foot 0;; - -in*stat*=*) setopt SURFRAW_debbugs_incstatus $optarg;; - -ex*stat*=*) setopt SURFRAW_debbugs_excstatus $optarg;; - -in*sev*=*) setopt SURFRAW_debbugs_incsev $optarg;; - -ex*sev*=*) setopt SURFRAW_debbugs_excsev $optarg;; - -in*tag*=*) setopt SURFRAW_debbugs_inctag $optarg;; + -arc*) setoptyn SURFRAW_debbugs_archive 1;; + -mer*) setoptyn SURFRAW_debbugs_merge 1;; + -raw*) setoptyn SURFRAW_debbugs_statussort 0;; + -noh*) setoptyn SURFRAW_debbugs_head 0;; + -nof*) setoptyn SURFRAW_debbugs_foot 0;; + -in*stat*=*) setopt SURFRAW_debbugs_incstatus $optarg;; + -ex*stat*=*) setopt SURFRAW_debbugs_excstatus $optarg;; + -in*sev*=*) setopt SURFRAW_debbugs_incsev $optarg;; + -ex*sev*=*) setopt SURFRAW_debbugs_excsev $optarg;; + -in*tag*=*) setopt SURFRAW_debbugs_inctag $optarg;; -ex*tag*=*) setopt SURFRAW_debbugs_exctag $optarg;; -rb*) setoptyn SURFRAW_debbugs_revbugs 1;; -rst*) setoptyn SURFRAW_debbugs_revstat 1;; -rse*) setoptyn SURFRAW_debbugs_revsev 1;; - -mb*) setoptyn SURFRAW_debbugs_asmbox 1;; - -sh*) setoptyn SURFRAW_debbugs_headers 1;; - -bo*) setoptyn SURFRAW_debbugs_boring 1;; + -mb*) setoptyn SURFRAW_debbugs_asmbox 1;; + -sh*) setoptyn SURFRAW_debbugs_headers 1;; + -bo*) setoptyn SURFRAW_debbugs_boring 1;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://bugs.debian.org/" else escaped_args=`w3_url_of_arg $w3_args` setoptyn donum 0 setoptyn domaint 0 case "$SURFRAW_debbugs_search" in bug*) setoptyn donum 1;; esac # default search unless searchtype set on cmdline if ifno setsearch then export escaped_args if perl -e 'if($ENV{escaped_args} =~/^((\#|\%23)(\s|\%20)*)?\d+$/) { exit 0; } exit 1;' then # %23 = uri escaped '#', %20=' ' setoptyn donum 1 elif perl -e 'if($ENV{escaped_args} =~/\%40|@/) { exit 0; } exit 1;' then # %40 = uri escaped '@' setopt SURFRAW_debbugs_search "maint" fi fi - + if ifyes donum then url="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=${escaped_args}" if yesno SURFRAW_debbugs_asmbox then url="$url&mbox=yes" fi if yesno SURFRAW_debbugs_headers then url="$url&trim=no" fi if yesno SURFRAW_debbugs_boring then url="$url&boring=yes" fi else url="http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=${SURFRAW_debbugs_search}&version=${SURFRAW_debbugs_version}&dist=${SURFRAW_debbugs_dist}&data=${escaped_args}" if yesno SURFRAW_debbugs_archive then url="$url&archive=yes" else url="$url&archive=no" fi if ifyes SURFRAW_debbugs_merge then url="$url&repeatmerged=no" fi if ifno SURFRAW_debbugs_statussort then url="$url&raw=yes" fi if ifno SURFRAW_debbugs_head then url="$url&show_list_header=no" fi if ifno SURFRAW_debbugs_foot then url="$url&show_list_footer=no" fi if ifyes SURFRAW_debbugs_revstat then url="$url&pend-rev=yes" fi if ifyes SURFRAW_debbugs_revsev then url="$url&sev-rev=yes" fi if ifyes SURFRAW_debbugs_revbugs then url="$url&bug-rev=yes" fi if [ "$SURFRAW_debbugs_incstatus" != "" ] then add=`echo "$SURFRAW_debbugs_incstatus"|perl -ne 's/pending/pending-fixed/g;s/open/pending/g;print(join("&pend-inc=","",split(/\s*,\s*/,$_)));'` url="${url}${add}" fi if [ "$SURFRAW_debbugs_excstatus" != "" ] then add=`echo "$SURFRAW_debbugs_excstatus"|perl -ne 'print(join("&pend-exc=","",split(/\s*,\s*/,$_)));'` url="${url}${add}" fi if [ "$SURFRAW_debbugs_incsev" != "" ] then add=`echo "$SURFRAW_debbugs_incsev"|perl -ne 'print(join("&sev-inc=","",split(/\s*,\s*/,$_)));'` url="${url}${add}" fi if [ "$SURFRAW_debbugs_excsev" != "" ] then add=`echo "$SURFRAW_debbugs_excsev"|perl -ne 'print(join("&sev-exc=","",split(/\s*,\s*/,$_)));'` url="${url}${add}" fi if [ "$SURFRAW_debbugs_inctag" != "" ] then add=`echo "$SURFRAW_debbugs_inctag"|perl -ne 'print(join("&include=","",split(/\s*,\s*/,$_)));'` url="${url}${add}" fi if [ "$SURFRAW_debbugs_exctag" != "" ] then add=`echo "$SURFRAW_debbugs_exctag"|perl -ne 'print(join("&exclude=","",split(/\s*,\s*/,$_)));'` url="${url}${add}" fi fi w3_browse_url "$url" fi diff --git a/elvi/discogs b/elvi/discogs index 6f5ec37..6ddbfc3 100755 --- a/elvi/discogs +++ b/elvi/discogs @@ -1,53 +1,53 @@ #!/bin/sh # elvis: discogs -- Search the Discogs database of music information (www.discogs.com) # Patroklos Argyroudis, argp at domain cs.tcd.ie, 20060823 . surfraw || exit 1 w3_config_hook() { def SURFRAW_discogs_category all } w3_usage_hook() { cat << EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search the Discogs database of music information (www.discogs.com) Local options: -category= Category to search all | artists | labels | releases | - catno + catno Default: $SURFRAW_discogs_category Environment: SURFRAW_discogs_category EOF w3_global_usage } w3_parse_option_hook() { opt="$1" optarg="$2" - + case "$opt" in -category=*) setopt SURFRAW_discogs_category $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://www.discogs.com/" else escaped_args=`w3_url_of_arg $w3_args` w3_browse_url "http://www.discogs.com/search?type=${SURFRAW_discogs_category}&q=${escaped_args}&btn=Search" fi # EOF diff --git a/elvi/dmoz b/elvi/dmoz index 9582be3..9ad0d43 100755 --- a/elvi/dmoz +++ b/elvi/dmoz @@ -1,81 +1,81 @@ #!/bin/sh # $Id$ # elvis: dmoz -- Search the Open Directory Project web directory (dmoz.org) # [email protected] 20040910 . surfraw || exit 1 w3_config_hook () { def SURFRAW_dmoz_category "" def SURFRAW_dmoz_searchtype "b" defyn SURFRAW_dmoz_kids 0 defyn SURFRAW_dmoz_teens 0 defyn SURFRAW_dmoz_mteens 0 } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [URL] Description: Search the Open Directory Project web directory (dmoz.org) Local options: -cat=CATEGORY Search category Default: all - Values: Arts, Business, Computers, Games, + Values: Arts, Business, Computers, Games, Health, Home, Kids_and_Teens, News, - Recreation, Reference, Regional, - Science, Shopping, Society, Sports, + Recreation, Reference, Regional, + Science, Shopping, Society, Sports, World, Adult Environment: SURFRAW_dmoz_category -type=SEARCHTYPE Search type Default: b Values: c - Categories Only s - Sites only b - Both Environment: SURFRAW_dmoz_searchtype -kids Sites for kids. Environment: SURFRAW_dmoz_kids -teens Sites for teens. Environment: SURFRAW_dmoz_teens -mteens Sites for mature teens. Environment: SURFRAW_dmoz_mteens EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -cat*=*) setopt SURFRAW_dmoz_category "$optarg" ;; -ty*=*) setopt SURFRAW_dmoz_searchtype "$optarg" ;; -ki*) setoptyn SURFRAW_dmoz_kids 1 ;; -te*) setoptyn SURFRAW_dmoz_teens 1 ;; -mt*) setoptyn SURFRAW_dmoz_mteens 1 ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://dmoz.org/" else escaped_args=`w3_url_of_arg $w3_args` url="http://search.dmoz.org/cgi-bin/search?search=${escaped_args}&all=no&cat=${SURFRAW_dmoz_category}&t=${SURFRAW_dmoz_searchtype}" if [ $SURFRAW_dmoz_kids -eq 1 ] then url="${url}&Kids=1" fi if [ $SURFRAW_dmoz_teens -eq 1 ] then url="${url}&Teens=1" fi if [ $SURFRAW_dmoz_mteens -eq 1 ] then url="${url}&Mteens=1" fi w3_browse_url "${url}" fi diff --git a/elvi/freedb b/elvi/freedb index 4316918..5e0e603 100755 --- a/elvi/freedb +++ b/elvi/freedb @@ -1,168 +1,168 @@ #!/bin/sh # $Id$ # elvis: freedb -- Search for cd track listings in FreeDB (www.freedb.org) # [email protected] 20030129 # notes at end of script . surfraw || exit 1 w3_config_hook () { # options defyn SURFRAW_freedb_artists 0 defyn SURFRAW_freedb_albums 0 defyn SURFRAW_freedb_songs 0 defyn SURFRAW_freedb_rest 0 defyn SURFRAW_freedb_all 0 defyn SURFRAW_freedb_id 0 defyn SURFRAW_freedb_allfields 0 defyn SURFRAW_freedb_allcats 1 defyn SURFRAW_freedb_bycat 0 def SURFRAW_freedb_cats "" def SURFRAW_freedb_page 1 # internal SURFRAW_freedb_default=1 } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search FreeDB (www.freedb.org) for cd track listings Local options: -artists Search artists Environment: SURFRAW_cddb_artists -albums Search albums Environment: SURFRAW_cddb_albums -songs Search songs Environment: SURFRAW_cddb_songs -rest Search the rest of the data Environment: SURFRAW_cddb_rest -all Search all fields Environment: SURFRAW_cddb_all Default: search artists and albums -id Search by CDDB ID. -bycat Sort results by category -cat=CATEGORY Category to search, repeat as needed Options: all blues classical country data folk jazz misc newage reggae rock soundtrack Default: all -page=PAGENUM Start at page PAGENUM Default: 1 EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -ar*) setopt SURFRAW_freedb_artists 1;setoptyn SURFRAW_freedb_default 0;; -alb*) setoptyn SURFRAW_freedb_albums 1;setoptyn SURFRAW_freedb_default 0;; -so*) setoptyn SURFRAW_freedb_songs 1;setoptyn SURFRAW_freedb_default 0;; -r*) setoptyn SURFRAW_freedb_rest 1;setoptyn SURFRAW_freedb_default 0;; -all) setoptyn SURFRAW_freedb_all 1;setoptyn SURFRAW_freedb_default 0;; -id) setoptyn SURFRAW_freedb_id 1;; -pag*=*) setopt SURFRAW_freedb_page $optarg ;; -bycat) setoptyn SURFRAW_freedb_bycat 1 ;; -cat*=*) if [ "$optarg" = "all" ]; then setoptyn SURFRAW_freedb_allcats 1 SURFRAW_freedb_cats="" - else + else setoptyn SURFRAW_freedb_allcats 0 SURFRAW_freedb_cats="${SURFRAW_freedb_cats}&cats%5B%5D=$optarg" fi ;; *) return 1 ;; esac return 0 } w3_config # disable requoting, doesn't work with this elvi. SURFRAW_quote_ifs=0 w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url http://www.freedb.org/ else escaped_args=`w3_url_of_arg $w3_args` SURFRAW_freedb_queryopts="page=${SURFRAW_freedb_page}&" if ifyes SURFRAW_freedb_id; then w3_browse_url "http://www.freedb.org/freedb_discid_check.php?discid=${escaped_args}&${SURFRAW_freedb_queryopts}" else if [ $SURFRAW_freedb_albums -eq 1 -o \ $SURFRAW_freedb_all -eq 1 -o \ $SURFRAW_freedb_default -eq 1 ] then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields%5B%5D=title&" fi if [ $SURFRAW_freedb_artists -eq 1 -o \ $SURFRAW_freedb_all -eq 1 -o \ $SURFRAW_freedb_default -eq 1 ] then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields%5B%5D=artist&" fi if [ $SURFRAW_freedb_songs -eq 1 -o \ $SURFRAW_freedb_all -eq 1 ] then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields%5B%5D=track&" fi if [ $SURFRAW_freedb_rest -eq 1 -o \ $SURFRAW_freedb_all -eq 1 ] then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}fields%5B%5D=rest&" fi if [ $SURFRAW_freedb_bycat = 1 ]; then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}grouping=category&" else SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}grouping=none&" fi if [ $SURFRAW_freedb_allcats = 1 ]; then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}allcats=YES&" else SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}allcats=NO${SURFRAW_freedb_cats}" fi if [ $SURFRAW_freedb_all = 1 ]; then SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}allfields=YES&" else SURFRAW_freedb_queryopts="${SURFRAW_freedb_queryopts}allfields=NO&" fi w3_browse_url "http://www.freedb.org/freedb_search.php?${SURFRAW_freedb_queryopts}words=${escaped_args}" fi fi #eg: http://www.freedb.org/freedb_search.php?words=swans&allfields=NO&fields=artist&fields=title&fields=track&fields=rest&allcats=NO&cats=blues&cats=classical&cats=country&cats=data&cats=folk&cats=jazz&cats=misc&cats=newage&cats=reggae&cats=rock&cats=soundtrack&grouping=cats # minimum: http://www.freedb.org/freedb_search.php?words=swans+are+dead&allfields=YES&allcats=YES&grouping=none # parameters: #words=search+words (compulsory) #allfields=YES | NO (compulsory) #fields=artist | title | track | rest (can be repeated as often as needed) #allcats=YES | NO (compulsory) #cats = blues | classical | country | data | folk | jazz | misc | newage | # reggae | rock | soundtrack (can be repeated as often as needed) #grouping=cats | none (compulsory) diff --git a/elvi/github b/elvi/github index c45a1bf..316d76a 100755 --- a/elvi/github +++ b/elvi/github @@ -1,67 +1,67 @@ #!/bin/sh # elvis: github -- Search GitHub (https://github.com) # Author: jason ryan • https://jasonwryan.com . surfraw || exit 1 w3_config_hook () { def SURFRAW_git_type "$SURFRAW_type" -def SURFRAW_git_lang any +def SURFRAW_git_lang any } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search-string] -Description: +Description: Search Github (https://github.com) Local options: -l=LANGUAGE | -lang=LANGUAGE - Languages are case sensitive, eg., C, Shell, Python etc. + Languages are case sensitive, eg., C, Shell, Python etc. Languages with spaces must be conjoined with a "+", eg, Common+Lisp Default: Any -type=SEARCH | -t=SEARCH - every | Everything + every | Everything repo | Repositories user | Users code | Code Default: Everything EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -t*=*) setopt SURFRAW_git_type $optarg ;; -l*=*) setopt SURFRAW_git_lang $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains list of arguments # type of search selected case "$SURFRAW_git_type" in every) type="Everything" ;; repo) type="Repositories" ;; user) type="Users" ;; code) type="Code" ;; *) type="Everything" ;; esac # No arguments parsed if [ -z "$w3_args" ]; then w3_browse_url "https://github.com" else # Language and/or search type selected escaped_args=$(w3_url_of_arg $w3_args) w3_browse_url "https://github.com/search?q=${escaped_args}&repo=&langOverride=&start_value=1&type=${type}&language=${SURFRAW_git_lang}" fi diff --git a/elvi/jamendo b/elvi/jamendo index ebc9a67..eb0beb8 100755 --- a/elvi/jamendo +++ b/elvi/jamendo @@ -1,68 +1,68 @@ #!/bin/sh # elvis: jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) . surfraw || exit 1 w3_config_hook () { def SURFRAW_jamendo_lang "$SURFRAW_lang" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search the web using Jamendo: free music with Creative Commons licenses (www.jamendo.com) Local options: -l= | -lang= Search with this l10n en|english fr|french de|german it|italian pt|portuguese pl|polish ru|russian es|spanish Default: English Environment: SURFRAW_jamendo_lang, SURFRAW_lang EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -l=*|-lang=*) setopt SURFRAW_jamendo_lang $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments # Use SURFRAW_lang if present if [ -z $SURFRAW_jamendo_lang ]; then SURFRAW_jamendo_lang="en"; fi if test -z "$w3_args"; then w3_browse_url "http://www.jamendo.com/${SURFRAW_jamendo_lang}/search" else case "$SURFRAW_jamendo_lang" in en|english) setopt SURFRAW_jamendo_lang en ;; fr|french) setopt SURFRAW_jamendo_lang fr ;; de|german) setopt SURFRAW_jamendo_lang de ;; it|italian) setopt SURFRAW_jamendo_lang it ;; pt|portuguese) setopt SURFRAW_jamendo_lang br;; - pl|polish) setopt SURFRAW_jamendo_lang pl ;; + pl|polish) setopt SURFRAW_jamendo_lang pl ;; ru|russian) setopt SURFRAW_jamendo_lang ru ;; es|spanish) setopt SURFRAW_jamendo_lang es ;; *) setopt SURFRAW_jamendo_lang en ;; esac escaped_args=`w3_url_of_arg $w3_args` w3_browse_url "http://www.jamendo.com/${SURFRAW_jamendo_lang}/search?qs=q=${escaped_args}" fi diff --git a/elvi/nlab b/elvi/nlab index f35d72a..2e086fe 100755 --- a/elvi/nlab +++ b/elvi/nlab @@ -1,29 +1,29 @@ #!/bin/sh # elvis: nlab -- Search the nLab Wiki (http://ncatlab.org) # author: jason ryan • http://jasonwryan.com . surfraw || exit 1 w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [search terms]... Description: Search the nLab Wiki (http://ncatlab.org) Local options: - The nLab wiki search accepts regular expressions as search terms. + The nLab wiki search accepts regular expressions as search terms. EOF w3_global_usage } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if [ -z "$w3_args" ]; then w3_browse_url "http://ncatlab.org/" else escaped_args=$(w3_url_of_arg $w3_args) w3_browse_url "http://ncatlab.org/nlab/search?&query=${escaped_args}" fi diff --git a/elvi/ntrs b/elvi/ntrs index c12a685..186b4ca 100755 --- a/elvi/ntrs +++ b/elvi/ntrs @@ -1,86 +1,86 @@ #!/bin/sh # -# author: Wim Van Hoydonck +# author: Wim Van Hoydonck # # elvis: ntrs -- Search the NASA Technical Report Server . surfraw || exit 1 w3_config_hook () { def SURFRAW_ntrs_fields Abstract def SURFRAW_ntrs_results matchall } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search-string] Description: Search ntrs Local options: -fields=FIELD Subject field to search all | Seach all fields abstract | Words in abstract (default) accession | Accession number center | NASA Center author | Author name docID | Document ID keywords | Keywords date | Publication date title | Title -results=RESULT Find Results with all | All of the words any | At least one of the words Examples: $w3_argv0 -fields=abstract -results=all free wake EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -fields=*) setopt SURFRAW_ntrs_fields $optarg ;; -results=*) setopt SURFRAW_ntrs_results $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments case "$SURFRAW_ntrs_fields" in all) field=All ;; abstract) field=Abstract ;; accession) field=AccessionNum ;; center) field=ArchiveName ;; author) field=AuthorList ;; docID) field=DocumentID ;; keyword) field=Keywords ;; date) field=PublicationDate ;; title) field=Title ;; *) field=Abstract ;; esac case "$SURFRAW_ntrs_results" in all) result=matchall ;; any) result=matchany ;; *) result=matchall ;; esac if null "$w3_args"; then w3_browse_url "http://ntrs.nasa.gov/search.jsp" else # TODO: combine multiple searches, e.g. - # first search the abstract for certain keywords, + # first search the abstract for certain keywords, # then search the authors of those results # this gives urls that look like this: #http://ntrs.nasa.gov/search.jsp?N=0&Ntk=Abstract|AuthorList&Ntx=mode%20matchall|mode%20matchall&Ntt=free%20wake|wachspress escaped_args=`w3_url_of_arg $w3_args` url="http://ntrs.nasa.gov/search.jsp?N=0&Ntk=${field}&Ntx=mode%20${result}&Ntt=${escaped_args}" w3_browse_url "${url}" fi diff --git a/elvi/openports b/elvi/openports index 75bf310..577be98 100755 --- a/elvi/openports +++ b/elvi/openports @@ -1,58 +1,58 @@ #!/bin/sh # elvis: openports -- search openports for OpenBSD packages # [email protected] 20110105 . surfraw || exit 1 w3_config_hook () { def SURFRAW_openports_search "http://openports.se/search.php?" def SURFRAW_openports_stype "" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Search openports for OpenBSD packages / ports. Only one search is active at a time. Feel free to n00b it up and use more than one flag. Go ahead, just try. Local options: -m,-maintainer search by maintainer -c,-comment search by comment -b,-builddeps search by build dependencies -r,-rundeps search by run dependencies -s,-mastersite search by master site -d,-description search by description -l,-commitlogs search by commit logs EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -m|-mai*) setopt SURFRAW_openports_stype "maintainer" ;; -c|-comme*) setopt SURFRAW_openports_stype "comment" ;; -b|-bu*) setopt SURFRAW_openports_stype "dependbuild" ;; -r|-ru*) setopt SURFRAW_openports_stype "dependrun" ;; -s|-mas*) setopt SURFRAW_openports_stype "MASTER_SITES" ;; -d|-de*) setopt SURFRAW_openports_stype "description" ;; -l|-commi*) setopt SURFRAW_openports_stype "commitlog" ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments escaped_args=`w3_url_of_arg $w3_args` if test -z $SURFRAW_openports_stype ; then url="${SURFRAW_openports_search}so=${escaped_args}" else url="${SURFRAW_openports_search}stype=${SURFRAW_openports_stype}&so=${escaped_args}" fi - + w3_browse_url $url diff --git a/elvi/pin b/elvi/pin index 28edd90..79b9a58 100755 --- a/elvi/pin +++ b/elvi/pin @@ -1,93 +1,93 @@ #!/bin/sh # elvis: pin -- Search Pinboard bookmarks (http://pinboard.in) # author: jason ryan • http://jasonwryan.com . surfraw || exit 1 w3_config_hook () { def SURFRAW_pinboard_tags "$SURFRAW_tags" def SURFRAW_pinboard_user "$SURFRAW_user" def SURFRAW_pinboard_new 0 def SURFRAW_pinboard_popular 0 } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search Pinboard bookmarks (http://pinboard.in) Local options: - Default search (without any options) includes tags, titles and descriptions + Default search (without any options) includes tags, titles and descriptions and is not limited to a specific number of search terms. -popular | -p Search popular tags -recent | -r Search recent tags - -tags=TAGS | -t=TAGS Only search tags (separate a maximum of 3 TAGS with + -tags=TAGS | -t=TAGS Only search tags (separate a maximum of 3 TAGS with a "+" eg., unix+linux) -user=NAME | -u=NAME Search a user's bookmarks - - + + EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -p* ) setoptyn SURFRAW_pinboard_popular 1 ;; -r* ) setoptyn SURFRAW_pinboard_new 1 ;; -t=*) setopt SURFRAW_pinboard_tags $optarg ;; -u=*) setopt SURFRAW_pinboard_user $optarg ;; *) return 1 ;; esac return 0 } # create tag string -tags () { +tags () { local IFS=+ for tag in $SURFRAW_pinboard_tags; do printf "%s" "t:$tag/" done } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments escaped_args=$(w3_url_of_arg $w3_args) base_url="https://pinboard.in/" # check for recent & popular if [ "$SURFRAW_pinboard_new" = 1 ]; then suffix="recent/" elif [ "$SURFRAW_pinboard_popular" = 1 ]; then suffix="popular" fi # Run through the other possibilities... -if [ -z "$w3_args" ]; then - +if [ -z "$w3_args" ]; then + if [ -n "$SURFRAW_pinboard_user" ] && [ -n "$SURFRAW_pinboard_tags" ]; then w3_browse_url "${base_url}u:$SURFRAW_pinboard_user/$(tags)" elif [ -n "$SURFRAW_pinboard_tags" ]; then w3_browse_url "${base_url}$(tags)" elif [ -n "$SURFRAW_pinboard_user" ]; then w3_browse_url "${base_url}u:$SURFRAW_pinboard_user" else w3_browse_url "$base_url${suffix}" fi elif [ -n "$w3_args" ]; then w3_browse_url "${base_url}search/?query=${escaped_args}&all=Search+All" else w3_browse_url "${base_url}" fi diff --git a/elvi/rfc b/elvi/rfc index 06b5acc..b643516 100755 --- a/elvi/rfc +++ b/elvi/rfc @@ -1,194 +1,194 @@ #!/bin/sh # $Id$ # elvis: rfc -- Search RFCs (internet standards documents) # [email protected] 20031220 . surfraw || exit 1 w3_config_hook () { def SURFRAW_rfc_search all def SURFRAW_rfc_field all def SURFRAW_rfc_results $SURFRAW_results def SURFRAW_rfc_output txt defyn SURFRAW_rfc_matchexact no defyn SURFRAW_rfc_showabs no defyn SURFRAW_rfc_showkw no defyn SURFRAW_rfc_reverse no defyn SURFRAW_rfc_ftp no defyn SURFRAW_rfc_nodirect no searchset=0 } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search the RFC (Request For Comments) internet standards. Local options: -results=NUM Number of search results returned Default: $SURFRAW_rfc_results Environment: SURFRAW_rfc_results -pdf Return files as PDF (Default: text) -rev Reverse order of results -exact Match exact words (instead of prefixes) -abs Show abstracts -keywords Show keywords -nodirect Don't try and go direct to RFC (Tries when arg is numeric and -search/-field not used) -ftp Retrieve RFCs via FTP instead of HTTP -field= Which field to search all | All fields - number | - title | - author | - keyword + number | + title | + author | + keyword Default: if args are numeric, "number", else "all" Environment: SURFRAW_rfc_field -search= Collection to search all | All rfc | Requests For Comments std | Standards bcp | Best Current Practices fyi Informational (For Your Information) Default: $SURFRAW_rfc_search Environment: SURFRAW_rfc_search EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -res*=*) setopt SURFRAW_rfc_results $optarg ;; -pdf*) setopt SURFRAW_rfc_output pdf ;; -rev*) setoptyn SURFRAW_rfc_reverse yes ;; -ex*) setoptyn SURFRAW_rfc_matchexact yes ;; -abs*) setoptyn SURFRAW_rfc_showabs yes ;; -k*) setoptyn SURFRAW_rfc_showkw yes ;; -ftp*) setoptyn SURFRAW_rfc_ftp yes ;; -no*) setoptyn SURFRAW_rfc_nodirect yes ;; -se*=*) setopt SURFRAW_rfc_search $optarg ;; -fi*=*) setopt SURFRAW_rfc_field $optarg ; searchset=1 ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://www.rfc-editor.org/rfcsearch.html" else escaped_args=`w3_url_of_arg $w3_args` # Is cmdline numeric? nodirect=0 if echo "$escaped_args" |grep '^[0-9]*$' >/dev/null 2>&1 then isnum=1 if ifyes SURFRAW_rfc_nodirect then nodirect=1 fi else isnum=0 fi # Do we want to go direct to rfc? if [ $isnum -eq 1 -a $searchset -eq 0 -a $nodirect -eq 0 ] then # do we want txt if [ "$SURFRAW_rfc_output" = "txt" ] then subdir="" case "$SURFRAW_rfc_search" in all) fileprefix="rfc";; rfc) fileprefix="rfc";; std) fileprefix="std"; subdir="/std";; bcp) fileprefix="bcp"; subdir="/bcp";; fyi) fileprefix="fyi"; subdir="/fyi";; *) echo "Unknown search: $SURFRAW_rfc_search"; exit;; esac if ifyes SURFRAW_rfc_ftp then url="ftp://ftp.rfc-editor.org/in-notes${subdir}/${fileprefix}${escaped_args}.txt" elif [ $fileprefix = rfc ] || [ $fileprefix = bcp ]; then url="http://tools.ietf.org/html/${fileprefix}${escaped_args}" else url="http://www.rfc-editor.org/rfc${subdir}/${fileprefix}${escaped_args}.txt" fi else # godless PDFs case "$SURFRAW_rfc_search" in all) ;; rfc) ;; *) echo "Only RFCs available as PDF files, not STDs, BCPs or FYIs. Try without -pdf"; exit 1;; esac # pdfs only available through ftp url="ftp://ftp.rfc-editor.org/in-notes/pdfrfc/rfc${escaped_args}.txt.pdf" fi else # not direct to rfc, construct url from options url="http://www.rfc-editor.org/cgi-bin/rfcsearch.pl?searchwords=${escaped_args}" if [ $isnum -eq 1 -a $searchset -eq 0 ] then url="$url&opt=Number" else case "$SURFRAW_rfc_field" in all*) url="$url&opt=All+Fields";; num*) url="$url&opt=Number";; tit*) url="$url&opt=Title";; auth*) url="$url&opt=Author";; key*) url="$url&opt=Keywords";; kw*) url="$url&opt=Keywords";; *) url="$url&opt=All+Fields";; esac fi - + url="$url&num=$SURFRAW_rfc_results" url="$url&filefmt=$SURFRAW_rfc_output" url="$url&search_doc=search_$SURFRAW_rfc_search" - + if ifyes SURFRAW_rfc_matchexact - then + then url="$url&match_method=entire" else url="$url&match_method=prefix" fi - + if ifyes SURFRAW_rfc_showabs then url="$url&abstract=abson" else url="$url&abstract=absoff" fi - + if ifyes SURFRAW_rfc_showkw then url="$url&keywords=keyon" else url="$url&keywords=keyoff" fi - + if ifyes SURFRAW_rfc_reverse then url="$url&sort_method=older" else url="$url&sort_method=newer" fi - + if ifyes SURFRAW_rfc_ftp then url="$url&format=ftp" else url="$url&format=http" fi fi w3_browse_url "$url" fi diff --git a/elvi/scicom b/elvi/scicom index 670fe2a..2be6caf 100755 --- a/elvi/scicom +++ b/elvi/scicom @@ -1,32 +1,32 @@ #!/bin/sh # -# author: Wim Van Hoydonck +# author: Wim Van Hoydonck # # elvis: scicom -- Search Scientific Commons . surfraw || exit 1 w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search-string] Description: Search Scientific Commons Examples: $w3_argv0 vortex pairs EOF w3_global_usage } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if null "$w3_args"; then w3_browse_url "http://www.scientificcommons.org" else escaped_args=`w3_url_of_arg $w3_args` url="http://www.scientificcommons.org/#search_string=${escaped_args}" w3_browse_url "${url}" fi diff --git a/elvi/sourceforge b/elvi/sourceforge index 61738be..451608f 100755 --- a/elvi/sourceforge +++ b/elvi/sourceforge @@ -1,63 +1,63 @@ #!/bin/sh # elvis: sourceforge -- Search SourceForge (www.sourceforge.net) # $Id$ . surfraw || exit 1 # version 0.2 [email protected] 20030910 # added -exact and -type # version 0.1 # this great work has been achieved by Caiaphas Pechorin ([email protected]) w3_config_hook () { defyn SURFRAW_sourceforge_exact no def SURFRAW_sourceforge_searchtype soft } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search SourceForge (www.sourceforge.net) Local options: -exact=yes|no Require all words Default: $SURFRAW_sourceforge_exact Environment: SURFRAW_sourceforge_exact -type= soft | Software / Group people | People freshmeat Freshmeat Default: $SURFRAW_sourceforge_searchtype Environment: SURFRAW_sourceforge_searchtype EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -e*=*) setoptyn SURFRAW_sourceforge_exact $optarg ;; -e*) setoptyn SURFRAW_sourceforge_exact yes ;; -t*=*) setopt SURFRAW_sourceforge_searchtype $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://www.sourceforge.net/" else escaped_args=`w3_url_of_arg $w3_args` - if `yesno SURFRAW_sourceforge_exact` + if `yesno SURFRAW_sourceforge_exact` then isexact=1 else isexact=0 fi w3_browse_url "http://sourceforge.net/search/?words=${escaped_args}&exact=$isexact&type_of_search=$SURFRAW_sourceforge_searchtype" fi diff --git a/elvi/springer b/elvi/springer index 6de33e5..692a06c 100755 --- a/elvi/springer +++ b/elvi/springer @@ -1,62 +1,62 @@ #!/bin/sh # -# author: Wim Van Hoydonck +# author: Wim Van Hoydonck # # elvis: springer -- Search Springer for Books and Articles . surfraw || exit 1 w3_config_hook () { def SURFRAW_spinger_fields All } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search-string] Description: Search springer Local options: -fields=FIELD Subject field to search all | Seach all fields (default) author | Author name title | Title series | Series isbn | ISBN/ISSN Examples: $w3_argv0 -fields=author featherstone EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -fields=*) setopt SURFRAW_springer_fields $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments case "$SURFRAW_springer_fields" in all) field=all ;; author) field=authorEditor ;; title) field=title ;; series) field=bookSeries ;; isbn) field=all ;; *) field=all ;; esac if null "$w3_args"; then w3_browse_url "http://www.springer.com" else escaped_args=`w3_url_of_arg $w3_args` url="http://www.springer.com/?searchKey=easySearchKey&searchType=easy&visited=true&propagate=false&resultStart=1&resultCount=10&SGWID=5-102-14-0-0&queryText=${escaped_args}&easySearchOption=${field}&go.x=8&go.y=7" w3_browse_url "${url}" fi diff --git a/elvi/translate b/elvi/translate index 7424537..02a346c 100755 --- a/elvi/translate +++ b/elvi/translate @@ -1,154 +1,154 @@ #!/bin/sh # $Id$ # elvis: translate -- Translate human languages . surfraw || exit 1 w3_config_hook () { def SURFRAW_translate_from "$SURFRAW_lang" def SURFRAW_translate_to "$SURFRAW_lang" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [words|URI]... Description: Surfraw translate human language Local options: -from=LANGUAGE Source language Environment: SURFRAW_translate_from, SURFRAW_lang -to=LANGUAGE Destination language Environment: SURFRAW_translate_to, SURFRAW_lang - + Languages (any provider): nl Dutch en English fr French de German el Greek it Italian ja Japanese ko Korean pt Portuguese ru Russian es Spanish Languages (Systrans only): zh Chinese (Simplified) zt Chinese (Traditional) Languages (Google only): auto Automatically detect language af Afrikaans sq Albanian ar Arabic hy Armenian az Azerbaijani eu Basque be Belarusian bg Bulgarian ca Catalan zh-CN Chinese (Simplified) zh-TW Chinese (Traditional) hr Croatian cs Czech da Danish et Estonian tl Filipino fi Finnish gl Galician ka Georgian ht Hatian Creole iw Hebrew - hi Hindi + hi Hindi hu Hungarian is Icelandic id Indonesian ga Irish la Latin lv Latvian lt Lithuanian mk Macedonian ms Malay mt Maltese no Norwegian fa Persian pl Polish ro Romanian sr Serbian sk Slovak sl Slovenian sw Swahili sv Swedish th Thai tr Turkish uk Ukrainian ur Urdu vi Vietnamese cy Welsh yi Yiddish Examples: $w3_argv0 Provider's standard translation page $w3_argv0 -from=fr -to=en la verite vous liberera $w3_argv0 -from=en -to=es http://tashian.com/multibabel Translate the given Web page Bugs: Systrans derived providers only support the following translation combinations: English to Chinese English to French English to German English to Italian English to Japanese English to Korean English to Portuguese English to Spanish Chinese to English French to English French to German German to English German to French Italian to English Japanese to English Korean to English Portuguese to English Russian to English Spanish to English EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -from=*) setopt SURFRAW_translate_from $optarg ;; -to=*) setopt SURFRAW_translate_to $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args" then w3_browse_url "http://translate.google.com/" else if [ -z "$SURFRAW_translate_to" ]; then SURFRAW_translate_to="en" fi if [ -z "$SURFRAW_translate_from" ]; then SURFRAW_translate_from="fr" fi escaped_args=`w3_url_of_arg $w3_args` case "$escaped_args" in http*) w3_browse_url "http://translate.google.com/translate?&sl=${SURFRAW_translate_from}&tl=${SURFRAW_translate_to}&u=${escaped_args}" ;; *) w3_browse_url "http://translate.google.com/?&sl=${SURFRAW_translate_from}&tl=${SURFRAW_translate_to}&q=${escaped_args}" ;; esac fi exit $? diff --git a/elvi/w3css b/elvi/w3css index 0694597..3631884 100755 --- a/elvi/w3css +++ b/elvi/w3css @@ -1,66 +1,66 @@ #!/bin/sh # $Id$ # elvis: w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) # [email protected] 20040909 . surfraw || exit 1 w3_config_hook () { def SURFRAW_w3css_warnings "1" def SURFRAW_w3css_profile "css2" def SURFRAW_w3css_medium "all" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [URL] Description: Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator/) Local options: -warnings=LEVEL Level of warnings displayed. Default: normal Values: all, normal, important, none Environment: SURFRAW_w3css_warnings -profile=PROFILE CSS Profile. Default: $SURFRAW_w3css_profile Values: none, css1, css2, css3, svg, svgbasic, svgtiny, mobile, atsv-tv, tv Environment: SURFRAW_w3css_profile -medium=MEDIUM User Medium Default: $SURFRAW_w3css_medium - Values: all, aural, braille, embossed, - handheld, print, projection, + Values: all, aural, braille, embossed, + handheld, print, projection, screen, tty, tv, presentation Environment: SURFRAW_w3css_medium EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -prof*=*) setopt SURFRAW_w3css_profile "$optarg" ;; -med*=*) setopt SURFRAW_w3css_medium "$optarg" ;; -warn*=*) case "$optarg" in [Aa]*) setopt SURFRAW_w3css_warnings "2" ;; [Nn][Oo][Rr]*) setopt SURFRAW_w3css_warnings "1" ;; [Ii]*) setopt SURFRAW_w3css_warnings "0" ;; [Nn][Oo][Nn]*) setopt SURFRAW_w3css_warnings "no" ;; *) echo "Invalid value $optarg"; exit 1 ;; esac ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://jigsaw.w3.org/css-validator/" else escaped_args=`w3_url_of_arg $w3_args` url="http://jigsaw.w3.org/css-validator/validator?uri=${escaped_args}&warning=${SURFRAW_w3css_warnings}&profile=${SURFRAW_w3css_profile}&usermedium=${SURFRAW_w3css_medium}" w3_browse_url "${url}" fi diff --git a/elvi/w3link b/elvi/w3link index 3e51a6e..40ed1fa 100755 --- a/elvi/w3link +++ b/elvi/w3link @@ -1,88 +1,88 @@ #!/bin/sh # $Id$ # elvis: w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) # [email protected] 20040908 . surfraw || exit 1 w3_config_hook () { def SURFRAW_w3link_depth -1 defyn SURFRAW_w3link_summary 1 defyn SURFRAW_w3link_hiderd 0 defyn SURFRAW_w3link_dhiderd 0 defyn SURFRAW_w3link_noacceptlanguage 0 defyn SURFRAW_w3link_recurse 0 defyn SURFRAW_w3link_cookie 0 } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [URL] Description: Check web page links with the w3c linkchecker (validator.w3.org/checklink) Local options: -r Check linked documents recursively. Environment: SURFRAW_w3link_recurse -d=DEPTH Recursion depth. Default: unlimited (-1) Environment: SURFRAW_w3link_depth -s Summary only. Environment: SURFRAW_w3link_summary -hiderd Hide Redirects. Environment: SURFRAW_w3link_hiderd -dhiderd Hide Redirects for directories only. Environment: SURFRAW_w3link_dhidedrd -nolang Don't send the Accept-Language: header. Environment: SURFRAW_w3link_noacceptlanguage - -cookie Save options in a cookie. + -cookie Save options in a cookie. Environment: SURFRAW_w3link_cookie EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -d*=*) setopt SURFRAW_w3link_depth "$optarg" ;; -r) setoptyn SURFRAW_w3link_recurse 1 ;; -s) setoptyn SURFRAW_w3link_summary 1 ;; -hiderd) setoptyn SURFRAW_w3link_hiderd 1 ;; -dhiderd) setoptyn SURFRAW_w3link_dhiderd 1 ;; -nolang) setoptyn SURFRAW_w3link_noacceptlanguage 1 ;; -cookie) setoptyn SURFRAW_w3link_cookie 1 ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://validator.w3.org/checklink" else escaped_args=`w3_url_of_arg $w3_args` url="http://validator.w3.org/checklink?uri=${escaped_args}&depth=${SURFRAW_w3link_depth}" if [ $SURFRAW_w3link_recurse -eq 1 -o $SURFRAW_w3link_depth -ge 0 ] then url="${url}&recursive=on" fi if [ $SURFRAW_w3link_summary -eq 1 ] then url="${url}&summary=on" fi if [ $SURFRAW_w3link_noacceptlanguage -eq 1 ] then url="${url}&no_accept_language=on" fi if [ $SURFRAW_w3link_hiderd -eq 1 ] then url="${url}&hide_redirects=on&hide_type=all" elif [ $SURFRAW_w3link_dhiderd -eq 1 ] then url="${url}&hide_redirects=on&hide_type=dir" fi w3_browse_url "${url}" fi diff --git a/elvi/w3rdf b/elvi/w3rdf index ea5346f..3f065af 100755 --- a/elvi/w3rdf +++ b/elvi/w3rdf @@ -1,133 +1,133 @@ #!/bin/sh # $Id$ # elvis: w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) # [email protected] 20040909 . surfraw || exit 1 w3_config_hook () { def SURFRAW_w3rdf_output "PRINT_TRIPLES" def SURFRAW_w3rdf_format "PNG_EMBEDDED" defyn SURFRAW_w3rdf_savedot 0 defyn SURFRAW_w3rdf_ntriples 0 defyn SURFRAW_w3rdf_embedded 0 defyn SURFRAW_w3rdf_useme 0 defyn SURFRAW_w3rdf_anon 0 def SURFRAW_w3rdf_node "Black" def SURFRAW_w3rdf_nodetext "Blue" def SURFRAW_w3rdf_arc "Darkgreen" def SURFRAW_w3rdf_arctext "Red" def SURFRAW_w3rdf_fontsize 10 def SURFRAW_w3rdf_orientation "LR" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [URL] Description: Validate a RDF URL with the w3c RDF validator (www.w3.org/RDF/Validator) Local options: -output=TYPE Type of output displayed. Values: Triples, Graphs, Both Default: Triples Environment: SURFRAW_w3rdf_output -format=TYPE Graph Format - Values: PNG_EMBED, PNG_LINK, SVG_LINK, + Values: PNG_EMBED, PNG_LINK, SVG_LINK, SVG_EMBED, GIF_EMBED, GIF_LINK, PS_LINK, HP_PCL_LINK, HP_GL_LINK, ISV_ZVTM Default: $SURFRAW_w3rdf_format Environment: SURFRAW_w3rdf_format -savedot Save GraphViz DOT file. Environment: SURFRAW_w3rdf_savedot -ntriples Display triples in N-Triples format Environment: SURFRAW_w3rdf_ntriples -embedded RDF is NOT enclosed in <RDF>..</RDF> tags. Environment: SURFRAW_w3rdf_embedded -useme I grant w3c permission to save the RDF for developing test cases. Environment: SURFRAW_w3rdf_useme -anon Make anonymous nodes unlabelled. Environment: SURFRAW_w3rdf_anon -fontsize=SIZE Font Size. Values: 10, 12, 14, 16, 20 Default: $SURFRAW_w3rdf_fontsize Environment: SURFRAW_w3rdf_fontsize -orient=ORIENTATION Orientation Values: TB (Top to Bottom), LR (Left to Right) Default: $SURFRAW_w3rdf_orientation Environment: SURFRAW_w3rdf_orientation -node=COLOUR Node Colour. Environment: SURFRAW_w3rdf_node Default: $SURFRAW_w3rdf_node -nodetext=COLOUR Node Text Colour. Environment: SURFRAW_w3rdf_nodetext Default: $SURFRAW_w3rdf_nodetext -arc=COLOUR Arc Colour. Environment: SURFRAW_w3rdf_arc Default: $SURFRAW_w3rdf_arc -arctext=COLOUR Arc Text Colour. Environment: SURFRAW_w3rdf_arctext Default: $SURFRAW_w3rdf_arctext Valid Colours: Black, Blue, Darkgreen, Red EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -out*=*) case "$optarg" in [Tt]*) setopt SURFRAW_w3rdf_output "PRINT_TRIPLES" ;; [Gg]*) setopt SURFRAW_w3rdf_output "PRINT_GRAPH" ;; [Bb]*) setopt SURFRAW_w3rdf_output "PRINT_GRAPH" ;; *) echo "Invalid value $optarg"; exit 1 ;; esac ;; -for*=*) setopt SURFRAW_w3rdf_format "$optarg" ;; -sav*) setoptyn SURFRAW_w3rdf_savedot 1 ;; -nt*) setoptyn SURFRAW_w3rdf_ntriples 1 ;; -em*) setoptyn SURFRAW_w3rdf_embedded 1 ;; -use*) setoptyn SURFRAW_w3rdf_useme 1 ;; -anon*) setoptyn SURFRAW_w3rdf_anon 1 ;; -font*=*) setopt SURFRAW_w3rdf_fontsize "$optarg" ;; -or*=*) setopt SURFRAW_w3rdf_orientation "$optarg" ;; -node=*) setopt SURFRAW_w3rdf_node "$optarg" ;; -nodet*) setopt SURFRAW_w3rdf_nodetext "$optarg" ;; -arc=*) setopt SURFRAW_w3rdf_arc "$optarg" ;; -arct*=*) setopt SURFRAW_w3rdf_arctext "$optarg" ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://www.w3.org/RDF/Validator/" else escaped_args=`w3_url_of_arg $w3_args` url="http://www.w3.org/RDF/Validator/ARPServlet?PARSE=PARSE_URI&URI=${escaped_args}&TRIPLES_AND_GRAPH=${SURFRAW_w3rdf_output}&FORMAT=${SURFRAW_w3rdf_format}&NODE_COLOR=${SURFRAW_w3rdf_node}&NODE_TEXT_COLOR=${SURFRAW_w3rdf_nodetext}&EDGE_COLOR=${SURFRAW_w3rdf_arc}&EDGE_TEXT_COLOR=${SURFRAW_w3rdf_arctext}&FONT_SIZE=${SURFRAW_w3rdf_fontsize}&ORIENTATION=${SURFRAW_w3rdf_orientation}" if [ $SURFRAW_w3rdf_savedot -eq 1 ] then url="${url}&SAVE_DOT_FILE=on" fi if [ $SURFRAW_w3rdf_ntriples -eq 1 ] then url="${url}&NTRIPLES=on" fi if [ $SURFRAW_w3rdf_embedded -eq 1 ] then url="${url}&EMBEDDED_RDF=on" fi if [ $SURFRAW_w3rdf_useme -eq 1 ] then url="${url}&SAVE_RDF=on" fi if [ $SURFRAW_w3rdf_anon -eq 1 ] then url="${url}&ANON_NODES_EMPTY=on" fi w3_browse_url "${url}" fi diff --git a/elvi/wolfram b/elvi/wolfram index 09f7d7b..939786a 100755 --- a/elvi/wolfram +++ b/elvi/wolfram @@ -1,41 +1,41 @@ #!/bin/sh # elvis: wolfram -- Ask questions of the computational knowledge engine # [email protected] 20110105 . surfraw || exit 1 w3_config_hook () { def SURFRAW_wolfram_results "$SURFRAW_results" def SURFRAW_wolfram_base_url "www.wolframalpha.com/" def SURFRAW_wolfram_search search def SURFRAW_wolfram_params "input/?i=" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search the web using wolfram (www.wolfram.com) Local options: - (null) + (null) EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments SURFRAW_wolfram_base_url="http://${SURFRAW_wolfram_base_url}" escaped_args=`w3_url_of_arg $w3_args` w3_browse_url "${SURFRAW_wolfram_base_url}${SURFRAW_wolfram_params}${escaped_args}" diff --git a/elvi/yacy b/elvi/yacy index 598bb1f..6cd91aa 100755 --- a/elvi/yacy +++ b/elvi/yacy @@ -1,73 +1,73 @@ #!/bin/sh # elvis: yacy -- Search YaCy P2P search, including ScienceNet . surfraw || exit 1 w3_config_hook () { def SURFRAW_yacy_results "$SURFRAW_results" def SURFRAW_yacy_site search.yacy.net defyn SURFRAW_yacy_image no defyn SURFRAW_yacy_indexonly no } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search YaCy P2P search, including ScienceNet Local options: -i, -images Image Search -I, -indexonly Constrain search to index pages -S search ScienceNet (sciencenet.kit.edu) -s=SITE, --site=SITE Search SITE Default: $SURFRAW_yacy_site Environment: SURFRAW_yacy_site -results=NUM Number of search results returned Default: $SURFRAW_yacy_results Environment: SURFRAW_yacy_results EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -i|-ima*) setoptyn SURFRAW_yacy_image yes ;; -I|-ind*) setoptyn SURFRAW_yacy_indexonly yes ;; -S) setopt SURFRAW_yacy_site sciencenet.kit.edu ;; -s=*) setopt SURFRAW_yacy_site "$optarg" ;; -r*=*) setopt SURFRAW_yacy_results "$optarg" ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" url="http://${SURFRAW_yacy_site}/" if test -z "$w3_args" ; then w3_browse_url "$url" else escaped_args=$(w3_url_of_arg $w3_args) url="${url}yacysearch.html?query=${escaped_args}&maximumRecords=${SURFRAW_yacy_results}" searchtype=text if ifyes SURFRAW_yacy_image then searchtype=image fi url="${url}&contentdom=${searchtype}" - + if ifyes SURFRAW_yacy_indexonly then url="${url}&indexof=on" fi url="${url}&Enter=Suchen&verify=ifexist&contentdom=text&nav=filetype%2Cprotocol%2Chosts%2Cnamespace%2Ctopics&startRecord=0&indexof=off&meanCount=5&resource=global&prefermaskfilter=" w3_browse_url "$url" fi diff --git a/examples/hooks.lua b/examples/hooks.lua index b14fde5..d05cb08 100644 --- a/examples/hooks.lua +++ b/examples/hooks.lua @@ -1,29 +1,29 @@ -- Using surfraw from elinks. To search using an elvi from -- the Go to URL dialog box, use the syntax "!elvis your --- search terms". E.g., to search for +-- search terms". E.g., to search for -- Wargames torrents in piratebay, type "!piratebay -- wargames" in the Go to URL dialog box. -- -- You need to have surfraw installed, obviously, and your -- lua install should have io.popen. function match (prefix, url) return string.sub (url, 1, string.len (prefix)) == prefix end function tosurfraw (str) return "surfraw -p " .. str .. " 2>/dev/null" end function goto_url_hook (url, current_url) if match ("!", url) then sr = tosurfraw (string.sub (url, 2)) urlfile = io.popen (sr) finalurl = urlfile:read('*all') urlfile:close() return finalurl else return url end end diff --git a/opensearch-genquery b/opensearch-genquery index 0b4d102..9e0f145 100755 --- a/opensearch-genquery +++ b/opensearch-genquery @@ -1,328 +1,328 @@ #!/usr/bin/perl -w # $Id$ # Ian Beckwith <[email protected]> # 20060830 use Getopt::Long; use strict; use vars qw($me); $me=($0=~/(?:.*\/)?(.*)/)[0]; use vars qw(@wantedtypes $htmlmime $atommime $rssmime); @wantedtypes=(); $htmlmime="text/html"; $atommime="application/atom+xml"; $rssmime ="application/rss+xml"; my $quiet=0; my $count=undef; my $startindex=undef; my $startpage=undef; my $language=undef; my $inputencoding=undef; my $outputencoding=undef; my $help=0; Getopt::Long::Configure("no_ignore_case"); GetOptions("quiet" => \$quiet, "H|html" => sub { push(@wantedtypes,$htmlmime); }, "A|atom" => sub { push(@wantedtypes,$atommime); }, "R|rss" => sub { push(@wantedtypes,$rssmime); }, "count=i" => \$count, "language=s" => \$language, "i|startindex=i" => \$startindex, "p|startpage=i" => \$startpage, "O|outputencoding=s" => \$outputencoding, "I|inputencoding=s" => \$inputencoding, "h|help" => \$help); if ($help || ($#ARGV<1)) { usage(); } my $url=shift; my $searchterms=join(' ',@ARGV); unless($url=~/^http\:\/\//i) { $url="http://".$url; } unless (eval { require WWW::OpenSearch; }) { unless($quiet) { print STDERR "$me: Cannot find WWW::OpenSearch, is it installed?\n"; } exit 4; } my $engine; eval { $engine=WWW::OpenSearch->new($url); }; if($@) { my $errstr=""; my $exitcode=0; if($@ =~/fetching/i) { $errstr="Error fetching $url"; $exitcode=1; } elsif(($@ =~/parsing/i) || ($@ =~/node\s+should/i)) { - $errstr="Error parsing OpenSearch Description at $url"; + $errstr="Error parsing OpenSearch Description at $url"; $exitcode=2; } else { # Some other error, probably because WWW::OpenSearch has changed $errstr=$@; $exitcode=5; } unless($quiet) { print STDERR "$me: $errstr\n"; } exit $exitcode; } my $desc=$engine->description(); # copy options to hash, translating from option name to OpenSearch param my %options=(); $options{searchTerms} = $searchterms; if(defined($count)) { $options{count} = $count; } if(defined($startindex)) { $options{startIndex} = $startindex; } if(defined($startpage)) { $options{startPage} = $startpage; } if(defined($language)) { $options{language} = $language; } if(defined($inputencoding)) { $options{inputEncoding} = $inputencoding; } if(defined($outputencoding)) { $options{outputEncoding} = $outputencoding; } my @urls=(); for (@{$desc->url()}) { if($_->method() =~ /^get$/i) { push(@urls,$_); } } my $besturl=undef; # if no preferred type specified use first Url. if($#wantedtypes<0) { $besturl=$urls[0]; } else # find best match against @wantedtypes { my $bestindex=undef; for my $urlindex (0..$#urls) { for(my $typeindex=0;$typeindex<=$#wantedtypes;$typeindex++) { if($urls[$urlindex]->type() eq $wantedtypes[$typeindex]) { if((!defined($bestindex)) || ($typeindex < $bestindex)) { $bestindex=$typeindex; $besturl=$urls[$urlindex]; } } } } } if(!defined($besturl)) { unless($quiet) { print STDERR "$me: No matching search type found\n"; } exit 3; } - + print $besturl->prepare_query(\%options),"\n"; exit 0; sub usage { die("Usage: $me [OPTIONS] URL SEARCH TERMS...\n". " Outputs the url of a query generated from an OpenSearch Description\n". " at URL with SEARCH TERMS filled in.\n". "Options:\n". " -q\t\tQuiet: Don't display errors.\n". " -H, -A, -R can be ordered to express response type priority.\n". " -H\t\tRequest HTML response.\n". " -A\t\tRequest Atom response.\n". " -R\t\tRequest RSS response.\n". " Not all sites implement all (or any) of the following options.\n". " Unimplemented options will be silently ignored.\n". " -c COUNT\tRequest COUNT results (OpenSearch param: count).\n". " -i INDEX\tRequest results start at NUM (OpenSearch param: startIndex).\n". " -p PAGENUM\tRequest results page PAGENUM (OpenSearch param: pageIndex).\n". " -l LANG\tRequest results in LANG (2-letter ISO country code) (OpenSearch param: language).\n". " -I ENC\t\tSpecify search terms are encoded in ENC (OpenSearch param: inputEncoding).\n". " -O ENC\t\tRequest results encoded in ENC (OpenSearch param: outputEncoding).\n". "Return codes:\n". " 0 - Success.\n". " 1 - Error fetching OpenSearch Description URL.\n". " 2 - Error parsing OpenSearch Description.\n". " 3 - No matching search type found.\n". " 4 - Cannot find perl module WWW::OpenSearch.\n". " 5 - Unhandled error from WWW::OpenSearch.\n"); } __END__ =head1 NAME opensearch-genquery - Output the URL of a query generated from an OpenSearch Description =head1 SYNOPSIS B<opensearch-genquery> [B<-q>] [B<-H>] [B<-A>] [B<-R>] S<[B<-c> I<COUNT>]> S<[B<-i> I<INDEX>]> S<[B<-p> I<PAGENUM>]> S<[B<-l> I<LANG>]> S<[B<-O> I<ENC>]> S<[B<-I> I<ENC>]> I<URL> S<I<SEARCH TERMS...>> =head1 DESCRIPTION Output the URL of a query generated from an OpenSearch Description file at I<URL>, with the specified S<I<SEARCH TERMS>> and other -options filled in. +options filled in. If multiple search types are available, B<-H>, B<-A> and B<-R> can be used to specify which type is wanted. For example, S<B<-A -R>> can be used to request an Atom response, or failing that fall back to RSS. By default the first URL found in the description file is used. Not all web sites implement all (or any) of the optional OpenSearch parameters. When used with those sites, the corresponding options will be silently ignored. =head1 OPTIONS =over 4 =item B<-q> Give no output on errors. In this case, consult the exit code to determine errors (See L</DIAGNOSTICS>). =item B<-H> Request HTML response. =item B<-A> Request Atom response. =item B<-R> Request RSS response. B<-H>, B<-A>, and B<-R> can be combined to express response type priority and specify fallback types. =item B<-c COUNT>, B<--count=COUNT> Request COUNT results. OpenSearch parameter: I<count>. =item B<-i INDEX>, B<--startindex=INDEX> Request results start at offset NUM. OpenSearch parameter: I<startIndex>. =item B<-p PAGENUM>, B<--startpage=PAGENUM> Request results page PAGENUM. OpenSearch parameter: I<pageIndex>. =item B<-l LANG>, B<--language=LANG> Request results in LANG. LANG should be a 2-letter ISO country code (e.g. B<en> or B<de>). OpenSearch parameter: I<language>. =item B<-O ENC>, B<--outputencoding=ENC> Request results encoded in ENC (default: UTF-8). OpenSearch parameter: I<outputEncoding>. =item B<-I ENC>, B<--inputencoding=ENC> Specify search terms are encoded in ENC (default: UTF-8). OpenSearch parameter: I<inputEncoding>. =item B<-h>, B<--help> Show a short help message. =item B<--> End of options. =back =head1 DIAGNOSTICS The exit code can be consulted to determine errors, as follows: =over 4 =item B<0> - Success. =item B<1> - Error fetching OpenSearch Description URL. =item B<2> - Error parsing OpenSearch Description. =item B<3> - No matching search type found. =item B<4> - Cannot find perl module WWW::OpenSearch. =item B<5> - Unhandled error from WWW::OpenSearch. =back =head1 DEPENDENCIES Requires the module WWW::OpenSearch (Debian package libwww-opensearch-perl). =head1 BUGS Only supports GET queries. Please report any bugs found to [email protected] =head1 SEE ALSO L<opensearch(1)>, L<opensearch-discover(1)>, L<surfraw(1)>, L<WWW::OpenSearch(3pm)>, L<http://www.opensearch.org/> =head1 AUTHOR Ian Beckwith <[email protected]> =head1 COPYRIGHT AND LICENSE Copyright 2006 Ian Beckwith <[email protected]> Licensed under the same terms as surfraw. =cut diff --git a/surfraw-bash-completion.IN b/surfraw-bash-completion.IN index 09444fc..5a7024e 100644 --- a/surfraw-bash-completion.IN +++ b/surfraw-bash-completion.IN @@ -1,33 +1,33 @@ # -*- sh -*- bash programmable completion for Surfraw, v2.2 # This is for people who wish to use surfraw completion, without # installing the bash-completion package which sets this explicitly. shopt -s extglob -_surfraw() +_surfraw() { COMPREPLY=() local cur=${COMP_WORDS[COMP_CWORD]} local prev=${COMP_WORDS[COMP_CWORD-1]} local opts='-browser -elvi -escape-url-args -graphical \ -help -q -quote -text -version' local elvi="$(cut -f1 @sysconfdir@/surfraw.bookmarks ~/.surfraw.bookmarks 2>&- cd @ELVIDIR@ && echo * 2>&- [ -d ~/.surfraw.d ] && cd ~/.surfraw.d && echo * 2>&-)" if [[ $cur == -* ]] then COMPREPLY=( $( compgen -W "$opts" -- $cur ) ) # I can't see a way to get the =yes/=no parts to work... elif [[ $COMP_CWORD -eq 1 ]] then COMPREPLY=( $( compgen -W "$elvi" -- $cur ) ) # "sr go<tab>" for google elif [[ $prev == @(alioth|deb@(bugs|contents|packages|pts|sec)|freshmeat|fsfdir|sourceforge) ]] then COMPREPLY=( $(apt-cache --generate pkgnames $cur) ) # "sr debbugs 4<tab>" to check 44bsd-rdist bugs... elif [[ -x /usr/bin/look ]] # in bsdmainutils, "important" then COMPREPLY=( $(/usr/bin/look ${cur:-''}) ) # "sr l<tab> vy<tab>" to find the German for "vying" else COMPREPLY=( $( compgen -o default -- $cur) ) # copout fi return 0 } # test first in case removed-but-unpurged type -p surfraw >/dev/null 2>&1 && complete -F _surfraw surfraw sr diff --git a/surfraw-update-path.IN b/surfraw-update-path.IN index 8bd30eb..e3d40c0 100755 --- a/surfraw-update-path.IN +++ b/surfraw-update-path.IN @@ -1,497 +1,497 @@ #!/usr/bin/perl -w # $Id$ # Ian Beckwith <[email protected]> 20030927 # adds surfraw's elvi directory to your PATH in your shell's config file # see end of file for POD documentation use strict; use Getopt::Long; use Fcntl qw(SEEK_END); use vars qw($me $elvidir); $me=($0=~/(?:.*\/)?(.*)/)[0]; $elvidir="@ELVIDIR@"; use vars qw($starttag $endtag); $starttag="### Added by surfraw."; $endtag ="### End surfraw addition."; use vars qw(%shells); %shells=( "bash" => \&sh_bash, "sh" => \&sh_posix, "ash" => \&sh_posix, "dash" => \&sh_posix, "csh" => \&sh_csh, "tcsh" => \&sh_csh, "pdksh" => \&sh_posix, "ksh" => \&sh_posix, "zsh" => \&sh_zsh, "rc" => \&sh_rc, "es" => \&sh_es, ); use vars qw($ADD $CHECK $REMOVE); $ADD = 0; $CHECK = 1; $REMOVE = 2; use vars qw($OK $NOTFOUND $ERROR); $OK=0; $NOTFOUND=1; $ERROR=2; use vars qw($POSIX $CSH $RC @syntax); $POSIX = 0; $CSH = 1; $RC = 2; @syntax=(); $syntax[$POSIX]="\texport PATH=\$PATH:$elvidir\n"; $syntax[$CSH]="\tsetenv PATH \"\${PATH}:$elvidir\"\n"; $syntax[$RC]="\tpath=(\$path $elvidir)\n"; my $sys=0; my $allshells=0; my $help=0; my $action=$CHECK; #default my $shell=$ENV{SHELL}; GetOptions('add' => sub { $action=$ADD; }, 'check' => sub { $action=$CHECK; }, 'remove' => sub { $action=$REMOVE; }, 'sys' => \$sys, 'shell=s' => \$shell, 'all' => \$allshells, 'help' => \$help); if($help) { usage(); exit 0; } if($allshells) { my $ret=0; my @shells=qw(sh csh zsh); # rc and es only have user startup files # bash sys startup file is same as sh unless($sys) { @shells=(@shells, qw(bash es rc)); } for my $s (@shells) { my $thisret=$shells{$s}($action,$sys); $ret=max($thisret,$ret); } exit $ret; } else { if(defined($shell)) { $shell=~s/.*\/\-?//; # strip path } else { print STDERR "$me: Cannot determine shell. Use -shell=shellname\n"; exit $ERROR; } unless(exists($shells{$shell})) { print STDERR "Shell $shell not supported, please manually add $elvidir to your \$PATH\n"; exit $ERROR; } - + exit($shells{$shell}($action,$sys)); } sub sh_posix { my($action,$sys)=@_; if($sys) { return scan("/etc/profile",$action,$sys,$POSIX); } elsif(exists($ENV{ENV})) { return scan($ENV{ENV},$action,$sys,$POSIX); } elsif(exists($ENV{HOME})) { return scan($ENV{HOME}."/.profile",$action,$sys,$POSIX); } else { print STDERR "$me: Cannot find home directory (\$HOME is not set)\n"; return $ERROR; } } sub sh_csh { my($action,$sys)=@_; if($sys) { return scan("/etc/csh.cshrc",$action,$sys,$CSH); } elsif(exists($ENV{HOME})) { return scan($ENV{HOME}."/.cshrc",$action,$sys,$CSH); } else { print STDERR "$me: Cannot find home directory (\$HOME is not set)\n"; return $ERROR; } } sub sh_bash { my($action,$sys)=@_; if($sys) { return scan("/etc/profile",$action,$sys,$POSIX); } elsif(exists($ENV{HOME})) { my $home=$ENV{HOME}; my $file; if(-r $home."/.bash_profile") { $file=$home."/.bash_profile"; } elsif(-r $home."/.bash_login") { $file=$home."/.bash_login"; } else { $file=$home."/.profile"; } # whether it exists or not # for interactive login shells my $ret1=scan($file,$action,$sys,$POSIX); # for interactive non-login shells my $ret2=scan($home."/.bashrc",$action,$sys,$POSIX); return(max($ret1,$ret2)); } else { print STDERR "$me: Cannot find home directory (\$HOME is not set)\n"; return $ERROR; } } -sub sh_zsh +sub sh_zsh { my($action,$sys)=@_; if($sys) { if(-d "/etc/zsh") { return scan("/etc/zsh/zshenv",$action,$sys,$POSIX); } else { return scan("/etc/zshenv",$action,$sys,$POSIX); } } elsif(exists($ENV{ZDOTDIR})) { return scan($ENV{ZDOTDIR}."/.zshenv",$action,$sys,$POSIX); } elsif(exists($ENV{HOME})) { return scan($ENV{HOME}."/.zshenv",$action,$sys,$POSIX); } else { print STDERR "$me: Cannot find home directory (\$HOME is not set)\n"; return $ERROR; } } sub sh_rc { my($action,$sys)=@_; if($sys) { print STDERR "$me: Shell rc has no system config file\n"; return $ERROR; } elsif(exists($ENV{HOME})) { return scan($ENV{HOME}."/.rcrc",$action,$sys,$RC); } else { print STDERR "$me: Cannot find home directory (\$HOME is not set)\n"; return $ERROR; } } sub sh_es { my($action,$sys)=@_; if($sys) { print STDERR "$me: Shell es has no system config file\n"; return $ERROR; } elsif(exists($ENV{HOME})) { return scan($ENV{HOME}."/.esrc",$action,$sys,$RC); } else { print STDERR "$me: Cannot find home directory (\$HOME is not set)\n"; return $ERROR; } } sub scan { my($file,$action,$sys,$type)=@_; - if(-e $file) + if(-e $file) { # file exists my $mode="<"; if(($action==$ADD) || ($action==$REMOVE)) { $mode="+<"; } unless(open(F,"$mode$file")) { print STDERR "$me: Cannot open $file: $!\n"; return $ERROR; } my $found=0; my $startoffset=0; my $aftertag=0; my $rest=''; my $offset=tell(F); while(<F>) { if(/$starttag/) { $found=1; $startoffset=$offset; } elsif($found && /$endtag/) { $aftertag=1; } elsif($aftertag) { $rest.=$_; } $offset=tell(F); } if($found) { if($action==$ADD) { print STDERR "$me: Surfraw config already present in $file\n"; return $OK; } elsif($action==$CHECK) { print("$me: Surfraw config present in $file\n"); return $OK; } else # remove { # move rest of file up to startoffset unless(truncate(F,$startoffset)) { print STDERR "$me: Cannot truncate $file: $!\n"; return $ERROR; } # just in case, seek to new end unless(seek(F,0, SEEK_END)) { print STDERR "$me: $file: Cannot seek: $!\n"; return $ERROR; } print F $rest; print "$me: Removed surfraw config code from $file\n"; return $OK; } } else # tag not found { if($action==$ADD) { # seek to end just in case unless(seek(F,0,SEEK_END)) { print STDERR "$me: $file: Cannot seek: $!\n"; return $ERROR; } print F maketag($sys,$type); print "$me: Added surfraw config code to $file\n"; return $OK; } elsif($action==$CHECK) { print "$me: surfraw config code not found in $file\n"; return $NOTFOUND; } else # remove { print STDERR "$me: cannot remove surfraw code: not found\n"; return $ERROR; } } unless(close(F)) { print STDERR "$me: Cannot close $file: $!\n"; return $ERROR; } } else # file doesnt exist { if($action==$CHECK) { print "$me: surfraw config code not found (file $file not found)\n"; return $NOTFOUND; } elsif($action==$REMOVE) { print STDERR "$me: Cannot remove surfraw config (file $file not found)\n"; return $ERROR; } else { # create file unless(open(F,">$file")) { print STDERR "$me: Cannot open $file for writing: $!\n"; return $ERROR; } print F maketag($sys,$type); unless(close(F)) { print STDERR "$me: Error closing $file: $!\n"; return $ERROR; } - chmod(0644,$file) or warn("$me: Could not set permissions on $file: $!\n"); + chmod(0644,$file) or warn("$me: Could not set permissions on $file: $!\n"); print "$me: Added surfraw config code to $file\n"; return $OK; } } } sub maketag { my ($sys,$type)=@_; my $remove=" To remove use $me -remove"; my $tag=$starttag; $tag .= $remove; if($sys) { $tag .= " -sys"; } $tag .= "\n"; $tag .= $syntax[$type]; $tag .= $endtag . "\n"; return $tag; } sub max { my($a,$b)=@_; return(($a>$b)?$a:$b); } sub usage { print "Usage: $me [-add] [-remove] [-check] [-sys] [-all] [-help] [-shell=SHELL]\n"; print " Adds code to your shell config to add $elvidir to your PATH.\n"; print "Options:\n"; print "\t-add Add surfraw code.\n"; print "\t-check Check if surfraw code is installed (Default).\n"; print "\t-remove Remove Surfraw code.\n"; print "\t-sys Alter system files rather than user files.\n"; print "\t-shell=SHELL Specify shell to configure (defaults to \$SHELL).\n"; print "\t-all Configure all known shells.\n"; print "\t-help This help.\n"; print "Supported shells: sh, ash, bash, dash, csh, tcsh, ksh, pdksh, zsh, rc, es\n"; } __DATA__ =head1 NAME surfraw-update-path - updates PATH in shell config files =head1 SYNOPSIS -surfraw-update-path [B<-add>] [B<-remove>] [B<-check>] [B<-sys>] [B<-all>] [B<-help>] [B<-shell>=I<SHELL>] +surfraw-update-path [B<-add>] [B<-remove>] [B<-check>] [B<-sys>] [B<-all>] [B<-help>] [B<-shell>=I<SHELL>] =head1 DESCRIPTION surfraw-update-path adds the surfraw elvi directory (@ELVIDIR@) to your PATH in your shell's config file. Currently it supports B<bash>, B<sh>, B<csh>, B<tcsh>, B<ash>, B<dash>, B<ksh>, B<pdksh>, B<zsh>, B<rc>, and B<es> Don't forget to login again or source your login files for it to take effect. =head1 OPTIONS =over 4 =item B<-check> Checks to see if the surfraw config code is present. This is the default. =item B<-add> Adds the surfraw config code. =item B<-remove> Removes the surfraw config code =item B<-sys> Updates the system-wide shell config instead of the user. Must be done as root. =item B<-shell>=I<SHELL> Selects the shell to configure. Defaults to the value of the $SHELL environment variable. Currently supported shells are: B<sh>, B<ash>, B<bash>, B<dash>, B<csh>, B<tcsh>, B<ksh>, B<pdksh>, B<zsh>, B<rc>, and B<es>. =item B<-all> Attempts to configure the startup files for all known shells =item B<-help> Gives a usage message =back =head1 RETURN VALUE -check returns 0 if the surfraw code is present in the file, 1 if it is not found, or 2 on error. All other options return 0 on success, or 2 on error. =head1 ENVIRONMENT =over 4 =item SHELL Used to determine which shell to configure, if B<-shell> is not given. =item HOME Used to find users config files. =item ENV Used by posix-compliant shells to specify a startup rc file. =item ZDOTDIR Used to find user config files for zsh. If not set, defaults to HOME. =back =head1 SEE ALSO surfraw(1), sh(1), ash(1), bash(1), dash(1), csh(1), tcsh(1), ksh(1), pdksh(1), zsh(1), rc(1), es(1) =head1 AUTHOR Ian Beckwith <[email protected]> =cut diff --git a/surfraw.1.IN b/surfraw.1.IN index 6eb7519..f05b890 100644 --- a/surfraw.1.IN +++ b/surfraw.1.IN @@ -1,398 +1,398 @@ .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH SURFRAW 1 "Feb 03, 2004" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp <n> insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME surfraw \- a fast unix command line interface to WWW services .SH SYNOPSIS .B surfraw .I elviname [options] search words ... .br .B sr .I elviname [options] search words ... .br .B sr \-elvi .br .B sr .I [options] bookmark [search words] .br .SH DESCRIPTION Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false\(hyprophet, pox\(hyinfested heathen lands of html\(hyforms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. .PP Surfraw consists of a collection of \fBelvi\fP, each of which knows how to search a specific web site. To see the list of elvi type: surfraw \-elvi Note that sr is an alias for surfraw, so that could equally be sr \-elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google \-l debian ports .SS Adding the elvi to your path - + If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (\%@ELVIDIR@) to your path, either manually or using \fB\%surfraw\-update\-path(1)\fP. .SS Bookmarks Surfraw supports bookmarks. To add a bookmark, add it to \fB\%@sysconfdir@/xdg/surfraw/bookmarks\fP or \fB\%$HOME/.config/surfraw/bookmarks\fP The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ If the url contains the string \fB%s\fP, you can specify an optional argument to the bookmark. Without an argument, only the domain will be returned. With arguments, \fb%s\fP will be replaced by the arguments. This obviates the need to create elvi for sites with very simple search options. To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in \%@sysconfdir@/xdg/surfraw/bookmarks .SH OPTIONS Use \fB\%sr elviname \-local\-help\fP for elvi\(hyspecific options. The following options work with all elvi. .TP .B \-help Show summary of options (including elvi\(hyspecific options). .TP .B \-local-help Show elvi\(hyspecific options. .TP .B \-version Show version of program. .TP \fB\-browser=\fP\fIEXECUTABLE\fP Set browser (default: sensible\-browser). .TP .B \-elvi Display a list of other Surfraw mechanisms for conquering evil. .TP .B \-escape\-url\-args=yes|no Apply url escaping to arguments (default: yes) .TP .B \-q|\-quote Bracket all arguments with " characters (default: no). Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine .SH EXAMPLES $ sr ask why is jeeves gay? $ surfraw google \-results=100 RMS, GNU, which is sinner, which is sin? $ sr austlii \-method=phrase dog like $ @ELVIDIR@/rhyme \-method=perfect Julian .SH CONFIGURATION Surfraw uses the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) to locate config files. The default locations are shown below, but can be modified by setting the environment variables .B $XDG_CONFIG_HOME and .B $XDG_CONFIG_DIRS. See the spec for more details. Surfraw gets its configuration from three sources, in order: .IP 1. 4 Environment variables .IP 2. \%@sysconfdir@/xdg/surfraw/conf .IP 3. \%$HOME/.config/surfraw/conf .PP @sysconfdir@/xdg/surfraw.conf and $HOME/.config/surfraw/conf are both fragments of bourne\(hyshell style shell script. @sysconfdir@/xdg/surfraw.conf should use def and defyn to define variables. These functions set variables unless they are already set by the environment. defyn is used for boolean configuration variables, def for all others. For instance: def SURFRAW_text_browser /usr/bin/lynx defyn SURFRAW_graphical no $HOME/.config/surfraw/conf should use sh\(hystyle entries, eg: SURFRAW_text_browser=/usr/bin/lynx SURFRAW_graphical=no This is because you want them to override environment variables unconditionally. .SH CONFIGURATION VARIABLES .TP .B SURFRAW_global_conf Location of global configuration file. Default: def SURFRAW_global_conf @sysconfdir@/xdg/surfraw/conf .TP .B SURFRAW_conf Location of per\(hyuser configuration file. Default: def SURFRAW_conf $HOME/.config/surfraw/conf .TP .B SURFRAW_graphical Whether to use a graphical browser. Default: defyn SURFRAW_graphical no .TP .B SURFRAW_text_browser Name/path of text browser executable. e.g. links, lynx, w3m Default: def SURFRAW_text_browser sensible\-browser .TP .B SURFRAW_graphical_browser Name/path of graphical browser executable. e.g mozilla, netscape etc. Default: def SURFRAW_graphical_browser sensible\-browser .TP .B SURFRAW_text_browser_args Text browser arguments, or "none". Default: def SURFRAW_text_browser_args none .TP .B SURFRAW_graphical_browser_args Graphical browser arguments, or "none". Default: def SURFRAW_graphical_browser_args none .TP .B SURFRAW_graphical_remote Whether to use "\fB\-remote openURL\fP" for graphical browser. Default: defyn SURFRAW_graphical_remote yes .TP .B SURFRAW_new_window When using SURFRAW_graphical_remote, open a new window? Default: defyn SURFRAW_new_window no .TP .B SURFRAW_screen Name of screen command to run. Default: def SURFRAW_screen screen .TP .B SURFRAW_new_screen If surfraw is running under screen(1), start a new screen for each text browser invocation? Default: defyn SURFRAW_new_screen no .TP .B SURFRAW_screen_args Arguments to pass to the SURFRAW_screen command Default: def SURFRAW_screen_args "" .TP .B SURFRAW_quote_args Whether to "quote" all the arguments. Default: defyn SURFRAW_quote_args no .TP .B SURFRAW_quote_ifs Whether to re\(hyquote arguments if they have spaces in, ie so: sr google foo "bar baz" bam .br works as expected. Default: defyn SURFRAW_quote_ifs yes .TP .B SURFRAW_results Default number of results to return (not supported by all elvi). Default: def SURFRAW_results 30 .TP .B SURFRAW_escape_url_args Whether to escape [% "$%&+,/:;<=>?@[\^{|}~'] characters in command line arguments subsequently used to construct a url. Default: defyn SURFRAW_escape_url_args yes .SH FILES .TP .B @ELVIDIR@ Location of the elvi. .TP .B ${HOME}/.config/surfraw/elvi Per\(hyuser elvi. .TP .B @sysconfdir@/xdg/surfraw/conf Default system wide configuration file. .TP .B $HOME/.config/surfraw/conf Default per\(hyuser config file .TP .B @sysconfdir@/xdg/surfraw/bookmarks System wide bookmarks file. .TP .B $HOME/.config/surfraw/bookmarks Per\(hyuser bookmarks file. .SH BUGS Please report any bugs found (or any web sites in need of surfrawizing) either via the debian bug tracking system (\%http://bugs.debian.org/) or to the surfraw\-devel list (\%surfraw\[email protected]). .SH SEE ALSO http://alioth.debian.org/projects/surfraw/ .SH PROPAGANDA .ce 1000 Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! .ce 0 Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the \fBS\fPhell \fBU\fPsers' \fBR\fPevolutionary \fBFr\fPont \fBA\fPgainst the WW\fBW\fP by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on surfraw\[email protected] .SH AUTHORS Originally written by Julian Assange. Now maintained by the surfraw\-devel team <\%surfraw\[email protected]>. See the file AUTHORS for the full list of contributors. Man page by Ian Beckwith, based on the original README and an earlier man page by Christian Surchi. .SH COPYRIGHT Copyright (c) 2003-2013 The Surfraw\-Devel Team <surfraw\[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study The copyright holders listed above assert no rights on this release of the software ``surfraw'' and thereby explicity place this release into the into the public domain. Do what you will. diff --git a/surfraw.IN b/surfraw.IN index a9daca1..0de3c96 100755 --- a/surfraw.IN +++ b/surfraw.IN @@ -1,693 +1,693 @@ #!/bin/sh # Surfraw -- Shell Users' Revolutionary Front Against the World wide web # # Copyright (c) 2003-2013 The Surfraw-Devel Team # <[email protected]> # Copyright (c) 2000-2001 Julian Assange, placed into the public domain # Copyright (c) 2000 Melbourne Institute for Advanced Study, placed into the public domain # # see the file COPYING for further copyright details # surfraw_version=@VERSION@ surfraw_api_version=1.0 w3_argv0=`basename "$0"` elvidir="@ELVIDIR@" # defaults w3_config_hook () { return 1 } find_global_conf () { base="$1" local conf OIFS conf="" if test -n "$XDG_CONFIG_DIRS"; then OIFS="$IFS" IFS=: set $XDG_CONFIG_DIRS IFS="$OIFS" for i in "$@"; do if test -r "$i/surfraw/$base"; then conf="$i/surfraw/$base" break fi done elif test -r "@sysconfdir@/xdg/surfraw/$base"; then # XDG default conf="@sysconfdir@/xdg/surfraw/$base" elif test -r "@sysconfdir@/surfraw.$base"; then # old surfraw default conf="@sysconfdir@/surfraw.$base" fi echo "$conf" } load_global_conf () { local conf if test -n "$SURFRAW_global_conf" && test -r "$SURFRAW_global_conf"; then conf="$SURFRAW_global_conf" else conf=$(find_global_conf conf) fi if test -z "$conf" || ! test -r "$conf"; then err "couldn't find global config in @sysconfdir@/xdg/surfraw/conf or \$XDG_CONFIG_DIRS" fi . "$conf" } find_local_conf () { base="$1" if test -n "$XDG_CONFIG_HOME" && test -r "$XDG_CONFIG_HOME/surfraw/$base"; then echo "$XDG_CONFIG_HOME/surfraw/$base" elif test -n "$HOME"; then if test -r "$HOME/.config/surfraw/$base"; then echo "$HOME/.config/surfraw/$base" elif test -r "$HOME/.surfraw.$base"; then echo "$HOME/.surfraw.$base" fi fi } load_local_conf () { local conf conf="" if test -n "$SURFRAW_conf" && test -r "$SURFRAW_conf"; then conf="$SURFRAW_conf" else conf="$(find_local_conf conf)" fi if test -n "$conf" && test -r "$conf"; then . $conf fi } get_local_elvi_dir () { if test -n "$XDG_CONFIG_HOME";then echo "$XDG_CONFIG_HOME/surfraw/elvi" elif test -n "$HOME";then echo "$HOME/.config/surfraw/elvi" fi } w3_config () { load_global_conf w3_config_hook load_local_conf } warn () { echo "$w3_argv0 WARNING: ""$@" >&2 } err () { echo "$w3_argv0 ERROR: ""$@" >&2 exit 1 } yesno () { eval value=\$${1} case `echo "$value" | tr A-Z a-z` in yes|true|on|1) return 0 ;; no|false|off|0) return 1 ;; *) err "\"$1\" is not set correctly. Should be (yes|on|1|no|off|0). Is \"$value\"" ;; esac } ifyes () { yesno "$@" && return 0 return 1 } ifno () { yesno "$@" && return 1 return 0 } ok () { yesno "$@" } null () { test -z "$@" && return 0 return 1 } def () { eval value=\$${1} test -z "$value" || return 0 eval ${1}="$2" return 0 } defyn () { eval value=\$${1} test -z "$value" && eval ${1}="$2" yesno "$1" } setopt () { eval value=\$${1} eval ${1}="$2" } setoptyn () { eval value=\$${1} eval ${1}="$2" yesno "$1" } quote_ifs () { if [ -z "$1" ]; then return; fi perl -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1" } bookmark_file_search () { search="$1" file="$2" if [ -r "$file" ] then @AWK@ -v search="$search" '$1 == search { for (nLoop = 2;nLoop <= NF; nLoop++) printf("%s ", $nLoop); print ""; }' $file | head -n 1 fi } bookmark_lookup () { search="$1" file=$(find_local_conf bookmarks) lookup=$(bookmark_file_search "$search" "$file") if [ -z "$lookup" ] then file=$(find_global_conf bookmarks) lookup=$(bookmark_file_search "$search" "$file") fi if [ -n "$lookup" ] then echo "$lookup" fi } w3_find_prog () { prog="$1" old_ifs="${IFS:-\" \"}" IFS=":" path_ifs="$PATH" for dir in $path_ifs; do test -z "$dir" && dir=. if test -e "$dir/$prog"; then echo "$dir/$prog" IFS="$old_ifs" return 0 fi done IFS="$old_ifs" return 1 } w3_url_escape () { echo "$@" | sed 's/%/%25/g; s/+/%2B/g; # s/ /+/g; s/ /%20/g; s/(/%28/g; s/)/%29/g; s/"/%22/g; s/#/%23/g; s/\$/%24/g; s/&/%26/g; s/,/%2C/g; # s/\./%2E/g; sx/x%2Fxg; s/:/%3A/g; s/;/%3B/g; s/</%3C/g; s/=/%3D/g; s/>/%3E/g; s/?/%3F/g; s/@/%40/g; s/\[/%5B/g; s/\\/%5C/g; s/\]/%5D/g; s/\^/%5E/g; s/{/%7B/g; s/|/%7C/g; s/}/%7D/g; s/~/%7E/g; s/`/%60/g; '"s/'/%27/g" } w3_url_of_arg () { if ok SURFRAW_quote_args; then args=\""$@"\" else args="$@" fi if ok SURFRAW_escape_url_args; then w3_url_escape "$args" else echo "$args" fi } true () { return 0 } false () { return 1 } w3_global_usage () { defyn SURFRAW_local_help no if ifyes SURFRAW_local_help; then return; fi # style: keep sorted #-------------------------------------79 cols---------------------------------- cat <<EOF Global options: -bookmark-search-elvis=ELVIS If args are passed to a non-searchable bookmark, search with this elvis instead. Default: $SURFRAW_bookmark_search_elvis Environment: SURFRAW_bookmark_search_elvis -browser=EXECUTABLE Set browser Default: $SURFRAW_browser -custom-search=PROVIDER Use PROVIDER for custom searches. Supported: google, duckduckgo Default: $SURFRAW_customsearch_provider Environment: SURFRAW_customsearch_provider -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: $SURFRAW_escape_url_args Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: $SURFRAW_graphical Environment: SURFRAW_graphical -h | -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: $SURFRAW_new_window Environment: SURFRAW_new_window -ns[=yes|no] Start in a new screen | -newscreen[=yes|no] Default: $SURFRAW_new_screen Environment: SURFRAW_new_screen -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: $SURFRAW_quote_args Environment: SURFRAW_quote_args -version Display Surfraw version ($surfraw_version) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study EOF } w3_usage_hook () { echo "Usage: $w3_argv0 [options] [args...]" w3_global_usage } w3_bad_option () { err "bad option \"${opt}\". Try ${w3_argv0} -help for usage information" } w3_parse_option_hook () { return 1 } list_elvi() { local dir="$1" sed -n 's/^.*elvis:[ ]\+\(.*\)$/\1/p' $(find "$dir" ! -type d ! -type l ! -name '*~' | sort) for script in $(find "$dir" ! -type d -type l | sort) ; do printf '%-16s--> %s\n' $(basename "$script") $(basename $(readlink "${script}")) done } w3_parse_option () { opt="$1" case "$opt" in -*=*) optarg=`echo "$opt" | sed 's/[-_a-zA-Z0-9]*=//'` esac w3_parse_option_hook "$opt" "$optarg" && return 0 case "$opt" in -bookmark-search-elvis=*) setopt SURFRAW_bookmark_search_elvis $optarg ;; -browser=*) setopt SURFRAW_browser $optarg ;; -elvi) echo " GLOBAL ELVI:" list_elvi "$elvidir" localelvidir=$(get_local_elvi_dir) if [ -d "$localelvidir" ] && [ -n "$(ls "$localelvidir")" ]; then echo " LOCAL ELVI:" list_elvi "$localelvidir" fi exit 0 ;; -escape-url-args=*) setoptyn SURFRAW_escape_url_args $optarg ;; -g | -graphical) setoptyn SURFRAW_graphical yes ;; -help | --help |-h) do_help=1 ;; -local-help | \ --local-help |-lh ) do_help=1 ;setoptyn SURFRAW_local_help yes ;; -q | -quote) setoptyn SURFRAW_quote_args yes ;; -new) setoptyn SURFRAW_new_window yes ;; -new=*) setoptyn SURFRAW_new_window $optarg ;; -ns | -newscreen) setoptyn SURFRAW_new_screen yes ;; -ns=* | -newscreen=*) setoptyn SURFRAW_new_screen $optarg ;; -custom-search=*) setopt SURFRAW_customsearch_provider $optarg ;; -o) setoptyn SURFRAW_dump yes ;; -o=*) setoptyn SURFRAW_dump yes setopt SURFRAW_dump_file $optarg ;; -t | -text) unset DISPLAY setoptyn SURFRAW_graphical no ;; -version) echo $surfraw_version; exit 0 ;; -p | -print) setoptyn SURFRAW_print yes ;; --) setoptyn SURFRAW_end_of_args yes ;; -*) w3_bad_option "$opt" ;; *) return 1 ;; esac return 0 } w3_parse_args () { w3_args= w3_shquoted_args= def SURFRAW_browser none def SURFRAW_browser_args none defyn SURFRAW_quote_ifs yes defyn SURFRAW_end_of_args no do_help=0 mode=unknown for arg in "$@"; do isarg=1 if ifno SURFRAW_end_of_args then w3_parse_option "$arg" isarg=$? fi if [ $isarg -eq 1 ] then if [ -z "$w3_shquoted_args" ] then w3_shquoted_args="`quote "$arg"`" else w3_shquoted_args="$w3_shquoted_args `quote "$arg"`" fi if ok SURFRAW_quote_ifs then arg=`quote_ifs "$arg"` fi if [ -n "$w3_args" ] then w3_args="$w3_args $arg" else w3_args="$arg" fi fi done if test $SURFRAW_browser = none; then if ok SURFRAW_graphical && test -n "$DISPLAY"; then SURFRAW_browser=$SURFRAW_graphical_browser SURFRAW_browser_args=$SURFRAW_graphical_browser_args mode=graphical else SURFRAW_browser=$SURFRAW_text_browser SURFRAW_browser_args=$SURFRAW_text_browser_args mode=text fi fi if ok do_help; then w3_usage_hook exit 0 fi } w3_dump () { if test -z "$SURFRAW_dump_file"; then SURFRAW_dump_file="-" fi if test -x "$(which curl)"; then curl -o "$SURFRAW_dump_file" "$@" elif test -x "$(which wget)"; then wget -q -O "$SURFRAW_dump_file" "$@" elif test -x "$(which GET)"; then if test "$SURFRAW_dump_file" = "-"; then GET "$@" else GET "$@" > "$SURFRAW_dump_file" fi else err "No URL fetcher found: install curl, wget or libwww-perl" fi } w3_browse_url () { if ok SURFRAW_new_screen && test `echo $TERM | cut -c 1-6` = "screen" && test $mode = text; then screen=yes else screen=no fi if ok SURFRAW_dump; then w3_dump "$@" elif ok SURFRAW_print; then echo "$@" elif ok screen; then if [ "$SURFRAW_screen" = "tmux" ]; then if test "$SURFRAW_browser_args" = "none"; then $SURFRAW_screen $SURFRAW_screen_args "$SURFRAW_browser \"$@\"" else $SURFRAW_screen $SURFRAW_screen_args "$SURFRAW_browser $SURFRAW_browser_args \"$@\"" fi else if test $SURFRAW_browser_args = "none"; then $SURFRAW_screen $SURFRAW_screen_args $SURFRAW_browser "$@" else $SURFRAW_screen $SURFRAW_screen_args $SURFRAW_browser $SURFRAW_browser_args "$@" fi fi else if ok SURFRAW_graphical_remote && test $mode = graphical; then - if ok SURFRAW_new_window; then + if ok SURFRAW_new_window; then newwin=", new-window" else newwin="" fi if test $SURFRAW_browser_args = "none"; then $SURFRAW_browser -remote "openURL($*$newwin)" 2>/dev/null || $SURFRAW_browser "$@" & else $SURFRAW_browser -remote "openURL($*$newwin)" 2>/dev/null || $SURFRAW_browser $SURFRAW_browser_args "$@" & fi else if test $SURFRAW_browser_args = "none"; then $SURFRAW_browser "$@" else $SURFRAW_browser $SURFRAW_browser_args "$@" fi fi fi } w3_custom_search_usage() { echo "Custom search:" echo " To choose which search engine gets used for custom searches," echo " configure SURFRAW_customsearch_provider" echo " or use -custom-search=PROVIDER" echo " supported: google, duckduckgo" echo " default: $SURFRAW_customsearch_provider" } w3_custom_search() { case "$SURFRAW_customsearch_provider" in google) w3_custom_search_google "$@" ;; duckduckgo) w3_custom_search_duckduckgo "$@" ;; ixquick) w3_custom_search_ixquick "$@" ;; *) w3_custom_search_duckduckgo "$@" ;; esac } w3_custom_search_google() { params=$(eval w3_custom_search_mangle -s site: $*) params=$(eval w3_custom_search_mangle -u inurl: $params) params=$(eval w3_custom_search_inurl_quote_dots $params) url="$(eval surfraw google -p $params )" w3_browse_url "$url" } w3_custom_search_duckduckgo() { params=$(eval w3_custom_search_mangle -s site: $*) params=$(eval w3_custom_search_mangle -u inurl: $params) url="$(eval surfraw duckduckgo -p $params )" w3_browse_url "$url" } w3_custom_search_ixquick() { params=$(eval w3_custom_search_mangle -s host: $*) params=$(eval w3_custom_search_mangle -u url: $params) url="$(eval surfraw ixquick -p $params )" w3_browse_url "$url" } w3_custom_search_mangle() { search="$1" replace="$2" shift shift for arg in "$@" do quote "$(echo "$arg" | sed "s/^${search}=\(.*\)/${replace}\1/")" done } w3_custom_search_inurl_quote_dots() { for arg in "$@" do if echo "$arg" | grep -q -- inurl: then quote "$(echo "$arg" | sed 's/\./\\./g;')" else quote "$arg" fi done } quote () { quoted=`echo "$1"|sed "s/'/'\\\\\''/g"` echo "'$quoted'" } surfraw_usage() { cat <<EOF Usage: $w3_argv0 [-help] [-elvi] elvis [elvioptions] [search terms] $w3_argv0 [options] bookmark [search terms] If you wish to run the elvi directly, run "surfraw-update-path" to append $elvidir to your \$PATH in your shell's config files. See surfraw-update-path(1) for details Options: -elvi List elvi -help This help sr is an alias for surfraw EOF w3_global_usage } # Browse URL or perform a search on URL(s) if search terms # are provided (use the user's elvis of choice if URL has no # %s field or multiple if multiple URLs are provided) parse_bookmark() { if [ -z "$w3_args" ]; then case "$bookmark" in *"%s"*) # Keep only the domain address, the rest contains %s which should be filtered. bookmark=$(echo $bookmark | @AWK@ -F '/' '{print $1 "//" $3}') ;; *) # Keep the first URL (if multiple-URL bookmark) as-is, no %s here... bookmark=$(echo $bookmark | cut -f 1 -d ' ') ;; esac else escaped_args=$(w3_url_of_arg $w3_args) case "$bookmark" in *"%s"*) bookmark="$(echo $bookmark | sed "s|\%s|$escaped_args|")" ;; *) [ -z $SURFRAW_bookmark_search_elvis ] && SURFRAW_bookmark_search_elvis=google bookmark=$(echo $bookmark | sed -e 's|^|site:|' \ -e 's|\ |\ OR\ site:|g' \ -e "s|^|$w3_args |" \ -e "s|^|$SURFRAW_bookmark_search_elvis |") ;; esac fi echo $bookmark } if [ "$w3_argv0" = "surfraw" -o "$w3_argv0" = "sr" ] then w3_config opts="" unquoted_opts="" unquoted_searchterms="" elvi="" searchterms="" do_help=0 for arg in "$@" do # if it is an option if [ "$(echo "$arg" | sed 's/^\(.\).*/\1/;' )" = "-" ] then # if option before elvi if [ -z "$elvi" ] then case "$arg" in -help | --help |-h) do_help=1 ;; -local-help | \ --local-help | \ -lh | -\? ) do_help=1 ; setoptyn SURFRAW_local_help yes ;; -elvi*) w3_parse_option -elvi; exit 0 ;; esac fi if ok do_help then surfraw_usage exit 0 fi if [ -z "$opts" ] then opts="`quote "$arg"`" unquoted_opts="$arg" else opts="$opts `quote "$arg"`" unquoted_opts="$unquoted_opts $arg" fi elif [ -z "$elvi" ] then elvi="$arg" else if [ -z "$searchterms" ] then searchterms="`quote "$arg"`" unquoted_searchterms="$arg" else searchterms="$searchterms `quote "$arg"`" unquoted_searchterms="$unquoted_searchterms $arg" fi fi done if [ -z "$elvi" ] then surfraw_usage exit 0 else localelvidir=$(get_local_elvi_dir) if [ -x "$localelvidir/$elvi" ] then sh -c "$localelvidir/$elvi $opts $searchterms" elif [ -x "$elvidir/$elvi" ] then sh -c "$elvidir/$elvi $opts $searchterms" else bookmark=`bookmark_lookup $elvi` if [ -n "$bookmark" ] then w3_parse_args $unquoted_opts $unquoted_searchterms bookmark=$(parse_bookmark) w3_browse_url "$bookmark" exit 0 else echo "`basename $0`: $elvi: No elvis or bookmark with that name" echo "Passing everything to browser and hoping for the best..." $BROWSER "$elvi $opts $unquoted_searchterms" exit 0 fi fi fi fi diff --git a/surfraw.spec.in b/surfraw.spec.in index 9c8e5a9..5c20107 100644 --- a/surfraw.spec.in +++ b/surfraw.spec.in @@ -1,70 +1,70 @@ # $Id$ %define name surfraw %define version @VERSION@ %define release 1 %define builddir $RPM_BUILD_DIR/%{name}-%{version} Name: %{name} Version: %{version} Release: %{release} -Vendor: Julian Assange +Vendor: Julian Assange Packager: Julian Assange [email protected] -#URL: +#URL: Source: %{name}-%{version}.tar.gz -#Patch: +#Patch: Group: Application/Generic Copyright: GPL -#Icon: -#Requires: +#Icon: +#Requires: BuildRoot: /var/tmp/%{name}-%{version} BuildArchitectures: noarch Summary: Shell Users Revolutionary Front Rage Against the Web %description Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with incremental text browsers, such as links, w3m (or even lynx), and screen(1), or netscape-remote a Surfraw liberateur is capable of research speeds that leave GUI tainted idolaters agape with fear and wonder. For example: $ ask why is jeeves gay? $ google -results=100 RMS, GNU, which is sinner, which is sin? $ austlii -method=phrase dog like $ rhyme -method=perfect Julian @configure_input@ %prep -%setup -n %{name}-%{version} +%setup -n %{name}-%{version} #%patch -p1 %build CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} make %install if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi mkdir -p $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT # Build the file-list automagically :) cd $RPM_BUILD_ROOT find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name} find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name} find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name} %clean rm -rf $RPM_BUILD_ROOT rm ../file.list.%{name} %files -f ../file.list.%{name} %doc README diff --git a/test/l1sp.test b/test/l1sp.test index 87e3943..ba2d0f4 100644 --- a/test/l1sp.test +++ b/test/l1sp.test @@ -1,2 +1,2 @@ l1sp defun -Results for +Results for
JNRowe/surfraw
4999059f0b5a7c061f061f4f3e3bc0b5b7157a64
Added commandlinefu elvis Courtesy of Lucas Hoffman.
diff --git a/AUTHORS b/AUTHORS index fa2027c..2bab204 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,165 +1,168 @@ AUTHORS Julian Assange <[email protected]> original author Christian Surchi <[email protected]> original debian maintainer elvi: debcontents, debbugs, debpackages Ian Beckwith <[email protected]> current debian maintainer elvi: alioth, bbcnews, bugzilla, deblists, freedb, imdb, scpan, codesearch, debwiki, lastfm, musicbrainz, opensearch, scholar, ctan, fsfdir, gutenberg, wayback, dmoz, w3html, w3link, w3css, w3rdf, debpts, rfc, lsm, finkpkg, rpmsearch, macports, debpkghome, debvcsbrowse, scroogle, scirus, scitopia, worldwidescience, debcodesearch, jquery, mdn, mysqldoc, pgdoc, oraclesearch, S, yacy, gmane plus various tweaks/bugfixes/features. Moritz Muehlenhoff <[email protected]> elvi: debsec, ebay, leodict, wikipedia, sharereactor, pgpkeys, happypenguin plus various patches/maintenance. Thomas Smith <[email protected]> Bugfixes, uploading. Stephen Stafford <[email protected]> Bug fixes Kevin Kreamer <[email protected]> Bug fixes Christian Weisgerber <[email protected]> elvi: fast, thesaurus, webster Jason Harris <[email protected]> elvi: freebsd, openbsd, filesearching, ftpfind Ruben Pollan <[email protected]> elvi: rae Ian Broadfoot <[email protected]> elvi: yubnub James Rowe <[email protected]> plus useful patches/maintenance. Aparna Jaitly <[email protected]> elvi: ixquick Justin B. Rye <[email protected]> elvi: cia, deblogs, etym, foldoc plus useful patches. Patroklos Argyroudis <[email protected]> elvi: discogs Simon Ernst <[email protected]> elvi: archpkg Ivy Foster <[email protected]> elvi: bookfinder, bugmenot plus various patches/maintenance Sumant Oemrawsingh <[email protected]> elvi: cliki, l1sp, mathworth, mininova, youtube plus patches, including the uzbl examples. Sadako <[email protected]> imdb fixes tczy <[email protected]> elvi: bing Simone Fittabile <[email protected]> elvi: acronym, gcache, jamendo plus patches. Micah Anderson <[email protected]> various patches René Reigel <[email protected]> elvi: aur J.R. Mauro <[email protected]> elvi: urban, piratebay, genportage Wim van Hoydonck <[email protected]> elvi: ntrs, springer, sc John Briggs <[email protected]> patch to google John Gruenenfelder <[email protected]> elvi: arxiv csh patch James TD Smith <[email protected]> elvi: javasun google country-specific options Charles Twardy <[email protected]> fixed cia Uspenskiy Andrey <[email protected]> elvi: yandex Jameson Rollins <[email protected]> elvi: ads plus tweaks. Jakob <[email protected]> elvi: pasearch Kyle Isom <[email protected]> elvi: cablesearch, duckduckgo, openports, wolfram plus various fixes/maintenance. Jason Ryan <[email protected]> elvi: archwiki, deli, github, stack, pin plus various fixes/maintenance Sara Fauzia <[email protected]> archpkg fix. Thomas Zervogiannis <[email protected]> Searchable bookmarks. Paulo Almeida <[email protected]> elvi: priberam Shain Singh <[email protected]> elvi: cisco, f5 Manolo Martínez <[email protected]> examples: elinks integration (hooks.lua) Jon Yamokoski <[email protected]> elvi: phpdoc +Lucas Hoffmann <l-m-h at web.de> + elvi: commandlinefu + THANKS TO Brian Nelson <[email protected]> Christian Garbs <[email protected]> Hector Blanco <[email protected]> Jeff Bailey <[email protected]> Mark W. Eichin <[email protected]> Teófilo Ruiz Suárez <[email protected]> Maru Dubshinki <[email protected]> Matt Kraai <[email protected]> Brian Mcdonald <[email protected]> Carl Fredrik Hammar <[email protected]> Andy Valencia <[email protected]> Philip Armstrong <[email protected]> Dan Jacobson <[email protected]> Sunil Nimmagadda <[email protected]> Michel <[email protected]> Nikos Apostolakis <[email protected]> Facundo Aguirre <[email protected]> Raphael Geissert <[email protected]> If we've missed anyone, let us know. diff --git a/ChangeLog b/ChangeLog index 9dc59cb..2b19208 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,516 @@ +2014-09-20 Lucas Hoffmann <l-m-h at web.de> + + * new elvi: commandlinefu + 2104-06-04 Jason Ryan <[email protected]> * new elvi: nlab 2013-12-10 Ian Beckwith <[email protected]> * yandex: disabled test: redirects to captcha when used with LWP. * Fix make distcheck: remove last traces of codesearch and scitopia. 2013-12-09 Ian Beckwith <[email protected]> * deja: disable tests, google groups now requires javascript. * gmane: fix test. * codesearch: removed, service shut down. * scitopia: removed, service shut down. * scicom: down, status unknown, made note in NEWS. 2013-12-08 Ian Beckwith <[email protected]> * new elvi: gmane * openbsd -mail: use gmane (directly, not via gmane elvi) * fix tests: ads, pgdoc, pin, yacy 2013-10-27 Ian Beckwith <[email protected]> * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. * pgdoc, wayback: fixed tests. 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. diff --git a/README b/README index ecb9f3f..ac4f0bc 100644 --- a/README +++ b/README @@ -1,400 +1,401 @@ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Home Page: http://surfraw.alioth.debian.org ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web New: http://surfraw.alioth.debian.org Old: http://surfraw.sourceforge.net/ Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, babelfish, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with netscape-remote or incremental text browsers, such as links (http://artax.karlin.mff.cuni.cz/~mikulas/links/), w3m (http://www.w3m.org/), and screen(1) a Surfraw liberateur is capable of navigating speeds that leave GUI tainted idolaters agape with fear and wonder. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine. ADDING THE ELVI TO YOUR PATH If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (usually /usr/lib/surfraw or /usr/local/lib/surfraw/) to your path, either manually or using surfraw-update-path(1). CONFIG FILES Surfraw implements the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) Essentially this means global config will be in /etc/xdg/surfraw/ and local config will be in $HOME/.config/surfraw/. This can be modified by setting $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME, see the spec for more details. If your system has a different sysconfdir set during configure, that will be used instead of /etc (for instance, /usr/local/etc). In the documentation below, only the default paths will be referred to. LOCAL ELVI Surfraw can use your own private elvi, store them in $HOME/.config/surfraw/elvi/. Local elvi will be listed separately at the end of 'surfraw -elvi'. Use existing elvi (e.g. google) as a template. If you think your elvi may be useful to others, consider submitting them to [email protected]. BOOKMARKS Surfraw now supports bookmarks. To add a bookmark, add it to to the global bookmark list in /etc/xdg/surfraw/bookmarks or to your personal bookmark list in $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks CUSTOM SEARCH Several elvi use a search engine with site: and inurl: keywords. The search engine used can be customized by setting the environment variable SURFRAW_customsearch_provider or using the command-line argument -customsearch= Currently google and duckduckgo are supported Examples: SURFRAW_customsearch_provider=duckduckgo sr mysqldoc -v=5.5 select sr pgdoc -customsearch=google -v=9.1 select The default is to use duckduckgo. Currently affected elvi: mdn mysqldoc netbsd openbsd pgdoc slinuxdoc INSTALLATION Surfraw is installed with the standard ./configure; make; make install procedure. See INSTALL for more details. If you obtained surfraw direct from the git repository rather than a release tarball, run ./prebuild to generate the autotools build files *before* running ./configure. Note that the opensearch elvis depends on the perl libraries WWW::OpenSearch, HTML::Parser and LWP (libwww-perl). If you don't want to install opensearch, use ./configure --disable-opensearch. Surfraw supports the following options to ./configure: --with-text-browser=BROWSER Use BROWSER as text-mode browser --with-graphical-browser=BROWSER Use BROWSER as graphical-mode browser --with-elvidir=DIR Use DIR as location for storing elvi --disable-opensearch Disable OpenSearch support --disable-sr Disable installing sr alias By default, the text and graphical browsers are detected from a list of installed browsers at configure time. elvidir defaults to $(libdir)/surfraw (probably /usr/local/lib/surfraw). EXAMPLES $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr wikipedia surfraw $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian OPTIONS Global options are common to all Surfraw elvi (clients). You can get a list of the currently installed elvi by just typing `surfraw -elvi'. For example: $ surfraw -elvi GLOBAL ELVI: W -- Activate Surfraw defined web-browser acronym -- Look for acronyms definitions (www.acronymfinder.com) ads -- Search SAO/NASA Astrophysics Data System alioth -- Search Alioth (alioth.debian.org) amazon -- Search the amazon.com bookstore archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/) archwiki -- Search the Arch Linux Wiki arxiv -- Search arXiv E-Print Archive for articles ask -- Question the web using Ask Jeeves (www.ask.com) aur -- Search aur.archlinux.org for PKGBUILDs austlii -- Search Australian Law docs (www.austlii.edu.au) bbcnews -- Search BBC News (news.bbc.co.uk) bing -- Search the web using Microsoft's Bing (www.bing.com) bookfinder -- Search for books using www.bookfinder.com bugmenot -- Bypass compulsory web registration with bugmenot.com bugzilla -- Search for bugs on Bugzilla bugtrackers cablesearch -- search for leaked diplomatic communications cia -- Search CIA documents at www.cia.gov cisco -- Search Cisco documentation (www.cisco.com) cite -- Search computer science papers (citeseerx.ist.psu.edu) cliki -- Search the common lisp wiki cnn -- Search on CNN (cnn.com) comlaw -- Search Australian Law using Comlaw (www.comlaw.gov.au) +commandlinefu -- Search on www.commandlinefu.com ctan -- Search the Comprehensive TeX Archive Network (ctan.org) currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) cve -- Search for CAN assignments in CVE debbugs -- Search the debian BTS (bugs.debian.org) debcodesearch -- Search debian source code debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) deblists -- Search debian mailing lists (lists.debian.org/search.html) deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net) debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) debpkghome -- Visit the home page for a Debian package debpts -- Search the Debian Package Tracking System (packages.qa.debian.org) debsec -- Search the Debian Security Tracker for CVE ids or package names debvcsbrowse -- Browse the VCS repository for a Debian package debwiki -- Search the Debian Wikis (wiki.debian.org & women.debian.org/wiki) deja -- Search usenet using Google Groups (groups.google.com) deli -- Search Delicious bookmarks discogs -- Search the Discogs database of music information (www.discogs.com) dmoz -- Search the Open Directory Project web directory (dmoz.org) duckduckgo -- Securely search the web using duckduckgo (www.duckduckgo.com) ebay -- Search the Ebay auction site etym -- Look up word origins at www.etymonline.com excite -- Search on Excite (www.excite.com) f5 -- Search F5 related information (www.f5.com) finkpkg -- Search Fink packages (pdb.finkproject.org) foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org) freebsd -- Search FreeBSD related information (www.freebsd.org) freedb -- Search for cd track listings in FreeDB (www.freedb.org) freshmeat -- Search Freshmeat (www.freshmeat.net) fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org) gcache -- Search the web using Google cache (www.google.com) genbugs -- Search the Gentoo bug tracker (bugs.gentoo.org) genportage -- Search gentoo-portage.com for packages github -- Search GitHub (https://github.com) gmane -- Search mailing list with gmane (gmane.org) google -- Search the web using Google (www.google.com) gutenberg -- Search for books on Project Gutenberg (gutenberg.org) imdb -- Search the Internet Movie Database (www.imdb.com) ixquick -- Search the web using ixquick [HTTPS] (www.ixquick.com) jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) javasun -- Search Java API docs (java.sun.com) jquery -- Search the jQuery documentation (api.jquery.com) l1sp -- Search lisp documentation lastfm -- Search last.fm leodict -- Search Leo's German <-> English dictionary (dict.leo.org) lsm -- Search the Linux Software Map macports -- Search macports packages (macports.org) mathworld -- Search Wolfram MathWorld mdn -- Search the mozilla developer network (developer.mozilla.org) mininova -- Search the mininova bittorent source. musicbrainz -- Search MusicBrainz (musicbrainz.org) mysqldoc -- Search mysql documentation (dev.mysql.com) netbsd -- Search NetBSD related information (www.netbsd.org) nlab -- Search the nLab wiki (http://ncatlab.org) ntrs -- Search the NASA Technical Report Server openbsd -- Search OpenBSD related information (www.openbsd.org) openports -- search openports for OpenBSD packages opensearch -- Search an OpenSearch-enabled website oraclesearch -- Search an OpenSearch-enabled website pasearch -- Search the unofficial Penny Arcade archives (pipefour.org/pa) pgdoc -- Search postgres documentation (www.pgdoc.com) pgpkeys -- Search the PGP key database phpdoc -- Search php documentation (php.net) pin -- Search Pinboard bookmarks (http://pinboard.in) piratebay -- Search The Pirate Bay (http://thepiratebay.org) priberam -- Look up word in Priberam online dictionary (www.priberam.pt/dlpo) pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov) rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) rfc -- Search RFCs (internet standards documents) rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com) rpmsearch -- Search for RPMs in various distros scholar -- Search Google Scholar (scholar.google.com) scicom -- Search Scientific Commons scirus -- Search for science using Scirus (scirus.com) scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org) slashdot -- Search stories on Slashdot (www.slashdot.org) slinuxdoc -- Search entries in LDP (www.linuxdoc.org) sourceforge -- Search SourceForge (www.sourceforge.net) springer -- Search Springer for Books and Articles stack -- Search Stack Overflow stockquote -- Get a single stock quote (multiple providers) thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com) translate -- Translate human languages urban -- Search urbandictionary.com for a definition w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) w3html -- Validate a web page URL with the w3c validator (validator.w3.org) w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org) webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com) wetandwild -- Real time weather information (many sources) wikipedia -- Search the free encyclopedia wikipedia woffle -- Search the web using Woffle (localhost:8080) wolfram -- Ask questions of the computational knowledge engine worldwidescience -- Search for science with www.worldwidescience.org yacy -- Search YaCy P2P search, including ScienceNet yahoo -- Search Yahoo categories (www.yahoo.com) yandex -- Search the web using Yandex (yandex.ru) youtube -- Search YouTube (www.youtube.com) yubnub -- Use the social command-line for the web (yubnub.org) All elvi have useful low calorie help, for example: Usage: rhyme [options] [search words]... Description: Surfraw search for rhymes and other word correlations using Lycos Rhyme (rhyme.lycos.com) Example: $ rhyme Julian $ rhyme -method=rel surfer Results: Hurclean St. Julien. surfboarder, bather, natator, swimmer Local options: -method= Type of word correlation to search for prefect | Perfect rhyme syn | Synonyms hom | Homophones cons | Consonsant rhymes only rel | Semantically related words sub | Phrases spell | Similar spellings pic | Pictures shake | Match with Shakespeare archives def Find wordnet definition Default: perfect Environment: SURFRAW_rhyme_method Global options: -browser=EXECUTABLE Set browser Default: sensible-browser -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: yes Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: yes Environment: SURFRAW_graphical -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: no Environment: SURFRAW_new_window -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: no Environment: SURFRAW_quote_args -version Display Surfraw version (2.2.7) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study If you just want to see the elvi-specific help, use elvi -lh or -local-help. The system wide configuration file can usually be found in /etc/xdg/surfraw/conf (but see 'Config files' above). This can be overridden by setting the environment variable SURFRAW_global_conf. Each user can also specify their own overrides, usually in $HOME/.config/surfraw/conf (again, see 'Config files' above). This can be overridden by setting SURFRAW_conf, either in the environment or the global config file. e.g SURFRAW_graphical_remote=yes SURFRAW_graphical_browser=mozilla SURFRAW_text_browser=w3m SURFRAW_pgpkeys_sigs=on INTEGRATION There is a browser plugin for Pentadactyl (a vimperator fork) at http://code.google.com/p/dactyl/issues/detail?id=320 For details, see: http://lists.alioth.debian.org/pipermail/surfraw-devel/2011-April/000916.html Code to integrate with uzbl is in examples/uzbl_load_url_from_surfraw RADICALIZATION Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on [email protected] _________________________________________________________________ README originally by Julian Assange Updated by Ian Beckwith _________________________________________________________________ See NEWS, and ChangeLog for a summary of changes. _________________________________________________________________ diff --git a/elvi/Makefile.am b/elvi/Makefile.am index b0345bc..6dec47e 100644 --- a/elvi/Makefile.am +++ b/elvi/Makefile.am @@ -1,130 +1,131 @@ # $Id$ elvidir=$(ELVIDIR) dist_elvi_SCRIPTS = \ S \ W \ acronym \ ads \ alioth \ amazon \ archpkg \ archwiki \ arxiv \ ask \ aur \ austlii \ bing \ bbcnews \ bookfinder \ bugmenot \ bugzilla \ cablesearch \ cia \ cisco \ cite \ cliki \ cnn \ comlaw \ + commandlinefu \ ctan \ currency \ cve \ debbugs \ debcodesearch \ debcontents \ deblists \ deblogs \ debpackages \ debpkghome \ debpts \ debsec \ debvcsbrowse \ debwiki \ deja \ deli \ discogs \ dmoz \ duckduckgo \ ebay \ etym \ excite \ f5 \ foldoc \ finkpkg \ freebsd \ freedb \ freshmeat \ fsfdir \ gcache \ genbugs \ genportage \ github \ gmane \ google \ gutenberg \ imdb \ ixquick \ jamendo \ javasun \ jquery \ l1sp \ lastfm \ leodict \ lsm \ macports \ mathworld \ mdn \ mininova \ musicbrainz \ mysqldoc \ netbsd \ nlab \ ntrs \ openbsd \ openports \ opensearch \ oraclesearch \ pasearch \ pgdoc \ pgpkeys \ phpdoc \ pin \ piratebay \ priberam \ pubmed \ rae \ rfc \ rhyme \ rpmsearch \ scholar \ scicom \ scirus \ scpan \ slashdot \ slinuxdoc \ sourceforge \ springer \ stack \ stockquote \ thesaurus \ translate \ urban \ w3css \ w3html \ w3link \ w3rdf \ wayback \ webster \ wetandwild \ wikipedia \ woffle \ wolfram \ worldwidescience \ yacy \ yahoo \ yandex \ youtube \ yubnub uninstall-local: -rmdir $(DESTDIR)$(PREFIX)/$(ELVIDIR) diff --git a/elvi/commandlinefu b/elvi/commandlinefu new file mode 100644 index 0000000..d3de574 --- /dev/null +++ b/elvi/commandlinefu @@ -0,0 +1,65 @@ +#!/bin/sh +# $Id$ +# elvis: commandlinefu -- search on www.commandlinefu.com +# The API of the site is described at http://www.commandlinefu.com/site/api. +. surfraw || exit 1 + +w3_config_hook () { + defyn SURFRAW_commandlinefu_votes 1 + def SURFRAW_commandlinefu_format html +} + +w3_usage_hook () { + cat <<EOF +Usage: $w3_argv0 [options] [search words]... +Description: + Surfraw search www.commandlinefu.com +Local options: + -html get results as html + -txt get results as plain text + -json get results as json + -rss get results as rss data + Default: $SURFRAW_commandlinefu_format + -v, -s, -votes, -sort sort results by votes + -u, -n, -unsort, -nosort do not sort results + Default: $SURFRAW_commandlinefu_votes +EOF + w3_global_usage +} + +w3_parse_option_hook () { + opt="$1" + optarg="$2" + case "$opt" in + -json) setopt SURFRAW_commandlinefu_format json ;; + -html) setopt SURFRAW_commandlinefu_format html ;; + -rss) setopt SURFRAW_commandlinefu_format rss ;; + -txt) setopt SURFRAW_commandlinefu_format plaintext ;; + -v|-votes|-s|-sort) setoptyn SURFRAW_commandlinefu_votes 1 ;; + -u|-unsort|-n|-nosort) setoptyn SURFRAW_commandlinefu_votes 0 ;; + *) return 1 ;; + esac + return 0 +} + +w3_config +w3_parse_args "$@" +# w3_args now contains a list of arguments + +url=http://www.commandlinefu.com/commands/matching +# The next part of the url is a normalized plaintext version of the search +# query. It seems to be unused by the CGI but it needs to be present. So we +# normalize to "x". +url=$url/x +# What is really used is the base64 encoded query. (echo -n is not portable) +url=$url/"`printf %s "$w3_args" | base64`" +# possibly add the sorting option +if test $SURFRAW_commandlinefu_votes -eq 1; then + url="$url/sort-by-votes" +fi +# add the output format option +if test $SURFRAW_commandlinefu_format != html; then + url="$url/$SURFRAW_commandlinefu_format" +fi + +w3_browse_url "$url" diff --git a/links.IN b/links.IN index 9fc4dc3..80db370 100644 --- a/links.IN +++ b/links.IN @@ -1,118 +1,119 @@ elvi.1sr.gz @mandir@/man1/W.1.gz elvi.1sr.gz @mandir@/man1/S.1sr.gz elvi.1sr.gz @mandir@/man1/acronym.1sr.gz elvi.1sr.gz @mandir@/man1/ads.1sr.gz elvi.1sr.gz @mandir@/man1/alioth.1sr.gz elvi.1sr.gz @mandir@/man1/amazon.1sr.gz elvi.1sr.gz @mandir@/man1/archpkg.1sr.gz elvi.1sr.gz @mandir@/man1/archwiki.1sr.gz elvi.1sr.gz @mandir@/man1/arxiv.1sr.gz elvi.1sr.gz @mandir@/man1/ask.1sr.gz elvi.1sr.gz @mandir@/man1/aur.1sr.gz elvi.1sr.gz @mandir@/man1/austlii.1sr.gz elvi.1sr.gz @mandir@/man1/bing.1sr.gz elvi.1sr.gz @mandir@/man1/bbcnews.1sr.gz elvi.1sr.gz @mandir@/man1/bookfinder.1sr.gz elvi.1sr.gz @mandir@/man1/bugmenot.1sr.gz elvi.1sr.gz @mandir@/man1/bugzilla.1sr.gz elvi.1sr.gz @mandir@/man1/cablesearch.1sr.gz elvi.1sr.gz @mandir@/man1/cite.1sr.gz elvi.1sr.gz @mandir@/man1/cia.1sr.gz elvi.1sr.gz @mandir@/man1/cliki.1sr.gz elvi.1sr.gz @mandir@/man1/cnn.1sr.gz elvi.1sr.gz @mandir@/man1/comlaw.1sr.gz +elvi.1sr.gz @mandir@/man1/commandlinefu.1sr.gz elvi.1sr.gz @mandir@/man1/ctan.1sr.gz elvi.1sr.gz @mandir@/man1/currency.1sr.gz elvi.1sr.gz @mandir@/man1/cve.1sr.gz elvi.1sr.gz @mandir@/man1/debbugs.1sr.gz elvi.1sr.gz @mandir@/man1/debcodesearch.1sr.gz elvi.1sr.gz @mandir@/man1/debcontents.1sr.gz elvi.1sr.gz @mandir@/man1/deblists.1sr.gz elvi.1sr.gz @mandir@/man1/deblogs.1sr.gz elvi.1sr.gz @mandir@/man1/debpackages.1sr.gz elvi.1sr.gz @mandir@/man1/debpkghome.1sr.gz elvi.1sr.gz @mandir@/man1/debpts.1sr.gz elvi.1sr.gz @mandir@/man1/debsec.1sr.gz elvi.1sr.gz @mandir@/man1/debvcsbrowse.1sr.gz elvi.1sr.gz @mandir@/man1/debwiki.1sr.gz elvi.1sr.gz @mandir@/man1/deja.1sr.gz elvi.1sr.gz @mandir@/man1/deli.1sr.gz elvi.1sr.gz @mandir@/man1/discogs.1sr.gz elvi.1sr.gz @mandir@/man1/dmoz.1sr.gz elvi.1sr.gz @mandir@/man1/duckduckgo.1sr.gz elvi.1sr.gz @mandir@/man1/ebay.1sr.gz elvi.1sr.gz @mandir@/man1/etym.1sr.gz elvi.1sr.gz @mandir@/man1/excite.1sr.gz elvi.1sr.gz @mandir@/man1/finkpkg.1sr.gz elvi.1sr.gz @mandir@/man1/foldoc.1sr.gz elvi.1sr.gz @mandir@/man1/freebsd.1sr.gz elvi.1sr.gz @mandir@/man1/freedb.1sr.gz elvi.1sr.gz @mandir@/man1/freshmeat.1sr.gz elvi.1sr.gz @mandir@/man1/fsfdir.1sr.gz elvi.1sr.gz @mandir@/man1/gcache.1sr.gz elvi.1sr.gz @mandir@/man1/genbugs.1sr.gz elvi.1sr.gz @mandir@/man1/genportage.1sr.gz elvi.1sr.gz @mandir@/man1/github.1sr.gz elvi.1sr.gz @mandir@/man1/google.1sr.gz elvi.1sr.gz @mandir@/man1/gutenberg.1sr.gz elvi.1sr.gz @mandir@/man1/imdb.1sr.gz elvi.1sr.gz @mandir@/man1/ixquick.1sr.gz elvi.1sr.gz @mandir@/man1/jamendo.1sr.gz elvi.1sr.gz @mandir@/man1/javasun.1sr.gz elvi.1sr.gz @mandir@/man1/lastfm.1sr.gz elvi.1sr.gz @mandir@/man1/leodict.1sr.gz elvi.1sr.gz @mandir@/man1/l1sp.1sr.gz elvi.1sr.gz @mandir@/man1/lsm.1sr.gz elvi.1sr.gz @mandir@/man1/macports.1sr.gz elvi.1sr.gz @mandir@/man1/mathworld.1sr.gz elvi.1sr.gz @mandir@/man1/mdn.1sr.gz elvi.1sr.gz @mandir@/man1/mininova.1sr.gz elvi.1sr.gz @mandir@/man1/musicbrainz.1sr.gz elvi.1sr.gz @mandir@/man1/mysqldoc.1sr.gz elvi.1sr.gz @mandir@/man1/netbsd.1sr.gz elvi.1sr.gz @mandir@/man1/ntrs.1sr.gz elvi.1sr.gz @mandir@/man1/openbsd.1sr.gz elvi.1sr.gz @mandir@/man1/openports.1sr.gz elvi.1sr.gz @mandir@/man1/opensearch.1sr.gz elvi.1sr.gz @mandir@/man1/oraclesearch.1sr.gz elvi.1sr.gz @mandir@/man1/pasearch.1sr.gz elvi.1sr.gz @mandir@/man1/pgdoc.1sr.gz elvi.1sr.gz @mandir@/man1/pgpkeys.1sr.gz elvi.1sr.gz @mandir@/man1/phpdoc.1sr.gz elvi.1sr.gz @mandir@/man1/pin.1sr.gz elvi.1sr.gz @mandir@/man1/piratebay.1sr.gz elvi.1sr.gz @mandir@/man1/priberam.1sr.gz elvi.1sr.gz @mandir@/man1/pubmed.1sr.gz elvi.1sr.gz @mandir@/man1/rae.1sr.gz elvi.1sr.gz @mandir@/man1/rfc.1sr.gz elvi.1sr.gz @mandir@/man1/rhyme.1sr.gz elvi.1sr.gz @mandir@/man1/rpmsearch.1sr.gz elvi.1sr.gz @mandir@/man1/scholar.1sr.gz elvi.1sr.gz @mandir@/man1/scicom.1sr.gz elvi.1sr.gz @mandir@/man1/scirus.1sr.gz elvi.1sr.gz @mandir@/man1/scpan.1sr.gz elvi.1sr.gz @mandir@/man1/slashdot.1sr.gz elvi.1sr.gz @mandir@/man1/slinuxdoc.1sr.gz elvi.1sr.gz @mandir@/man1/sourceforge.1sr.gz elvi.1sr.gz @mandir@/man1/springer.1sr.gz elvi.1sr.gz @mandir@/man1/stack.1sr.gz elvi.1sr.gz @mandir@/man1/stockquote.1sr.gz elvi.1sr.gz @mandir@/man1/thesaurus.1sr.gz elvi.1sr.gz @mandir@/man1/translate.1sr.gz elvi.1sr.gz @mandir@/man1/urban.1sr.gz elvi.1sr.gz @mandir@/man1/w3css.1sr.gz elvi.1sr.gz @mandir@/man1/w3html.1sr.gz elvi.1sr.gz @mandir@/man1/w3link.1sr.gz elvi.1sr.gz @mandir@/man1/w3rdf.1sr.gz elvi.1sr.gz @mandir@/man1/wayback.1sr.gz elvi.1sr.gz @mandir@/man1/webster.1sr.gz elvi.1sr.gz @mandir@/man1/wetandwild.1sr.gz elvi.1sr.gz @mandir@/man1/wikipedia.1sr.gz elvi.1sr.gz @mandir@/man1/woffle.1sr.gz elvi.1sr.gz @mandir@/man1/wolfram.1sr.gz elvi.1sr.gz @mandir@/man1/worldwidescience.1sr.gz elvi.1sr.gz @mandir@/man1/yacy.1sr.gz elvi.1sr.gz @mandir@/man1/yahoo.1sr.gz elvi.1sr.gz @mandir@/man1/yandex.1sr.gz elvi.1sr.gz @mandir@/man1/youtube.1sr.gz elvi.1sr.gz @mandir@/man1/yubnub.1sr.gz diff --git a/test/commandlinefu.test b/test/commandlinefu.test new file mode 100644 index 0000000..a5dc9c7 --- /dev/null +++ b/test/commandlinefu.test @@ -0,0 +1,10 @@ +commandlinefu +is the place to record those command-line gems that you return to again and again +commandlinefu find something +Terminal - Commands matching find something - [\d,]+ results +commandlinefu -txt test +^# commandlinefu.com by David Winterbottom\n +commandlinefu -json test +^\[\{"id":"\d+","command":.*\}\]$ +commandlinefu -rss test +</rss>
JNRowe/surfraw
af565c5e2bcc5c0a8c36b81e1a8b9b95f7de7180
Fixed images and maps in yandex
diff --git a/elvi/yandex b/elvi/yandex index f345691..fb9c014 100755 --- a/elvi/yandex +++ b/elvi/yandex @@ -1,49 +1,50 @@ #!/bin/sh # $Id$ # elvis: yandex -- Search the web using Yandex (yandex.ru) . surfraw || exit 1 w3_config_hook () { def SURFRAW_yandex_search "${search:-yandsearch?}text" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Surfraw search the web using Yandex (yandex.ru) Local options: Specialized search on topic -dict | Slovari -news | News -images | Images -market | Market - -maps | Maps (not implemented) + -maps | Maps EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -dict) search="search.xml?" opt=slovari ;; -news) search="yandsearch?rpt=nnews2\&" ;; -market) search="search.xml?" ;; - -images|-maps) : ;; + -images) search="search?" ;; + -maps) search="?" ;; *) return 1 esac setopt SURFRAW_yandex_domain "${opt:+${opt#-}.}" [ -n $search ] && setopt SURFRAW_yandex_search "${search}text" return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments if test -z "$w3_args"; then w3_browse_url "http://${SURFRAW_yandex_domain}yandex.ru/" else escaped_args=`w3_url_of_arg $w3_args` w3_browse_url "http://${SURFRAW_yandex_domain}yandex.ru/${SURFRAW_yandex_search}=${escaped_args}" fi
JNRowe/surfraw
e0ad6f0f228249895d11bc81139c8a64147a4739
New elvis: nlab
diff --git a/elvi/nlab b/elvi/nlab new file mode 100755 index 0000000..f35d72a --- /dev/null +++ b/elvi/nlab @@ -0,0 +1,29 @@ +#!/bin/sh +# elvis: nlab -- Search the nLab Wiki (http://ncatlab.org) +# author: jason ryan • http://jasonwryan.com + +. surfraw || exit 1 + +w3_usage_hook () { + cat <<EOF +Usage: $w3_argv0 [search terms]... +Description: + Search the nLab Wiki (http://ncatlab.org) + + Local options: + The nLab wiki search accepts regular expressions as search terms. + +EOF + w3_global_usage +} + +w3_config +w3_parse_args "$@" + +# w3_args now contains a list of arguments +if [ -z "$w3_args" ]; then + w3_browse_url "http://ncatlab.org/" +else + escaped_args=$(w3_url_of_arg $w3_args) + w3_browse_url "http://ncatlab.org/nlab/search?&query=${escaped_args}" +fi diff --git a/test/nlab.test b/test/nlab.test new file mode 100644 index 0000000..ad6ae74 --- /dev/null +++ b/test/nlab.test @@ -0,0 +1,2 @@ +nlab dirac +Dirac induction
JNRowe/surfraw
ba34513a03e877fbc77e804693645abd0fc9f133
Added new elvis: nlab
diff --git a/ChangeLog b/ChangeLog index e6a3e22..9dc59cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,516 @@ +2104-06-04 Jason Ryan <[email protected]> + + * new elvi: nlab + 2013-12-10 Ian Beckwith <[email protected]> * yandex: disabled test: redirects to captcha when used with LWP. * Fix make distcheck: remove last traces of codesearch and scitopia. 2013-12-09 Ian Beckwith <[email protected]> * deja: disable tests, google groups now requires javascript. * gmane: fix test. * codesearch: removed, service shut down. * scitopia: removed, service shut down. * scicom: down, status unknown, made note in NEWS. 2013-12-08 Ian Beckwith <[email protected]> * new elvi: gmane * openbsd -mail: use gmane (directly, not via gmane elvi) * fix tests: ads, pgdoc, pin, yacy 2013-10-27 Ian Beckwith <[email protected]> * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. * pgdoc, wayback: fixed tests. 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> diff --git a/README b/README index f02c097..ecb9f3f 100644 --- a/README +++ b/README @@ -1,399 +1,400 @@ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Home Page: http://surfraw.alioth.debian.org ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web New: http://surfraw.alioth.debian.org Old: http://surfraw.sourceforge.net/ Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, babelfish, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with netscape-remote or incremental text browsers, such as links (http://artax.karlin.mff.cuni.cz/~mikulas/links/), w3m (http://www.w3m.org/), and screen(1) a Surfraw liberateur is capable of navigating speeds that leave GUI tainted idolaters agape with fear and wonder. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine. ADDING THE ELVI TO YOUR PATH If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (usually /usr/lib/surfraw or /usr/local/lib/surfraw/) to your path, either manually or using surfraw-update-path(1). CONFIG FILES Surfraw implements the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) Essentially this means global config will be in /etc/xdg/surfraw/ and local config will be in $HOME/.config/surfraw/. This can be modified by setting $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME, see the spec for more details. If your system has a different sysconfdir set during configure, that will be used instead of /etc (for instance, /usr/local/etc). In the documentation below, only the default paths will be referred to. LOCAL ELVI Surfraw can use your own private elvi, store them in $HOME/.config/surfraw/elvi/. Local elvi will be listed separately at the end of 'surfraw -elvi'. Use existing elvi (e.g. google) as a template. If you think your elvi may be useful to others, consider submitting them to [email protected]. BOOKMARKS Surfraw now supports bookmarks. To add a bookmark, add it to to the global bookmark list in /etc/xdg/surfraw/bookmarks or to your personal bookmark list in $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks CUSTOM SEARCH Several elvi use a search engine with site: and inurl: keywords. The search engine used can be customized by setting the environment variable SURFRAW_customsearch_provider or using the command-line argument -customsearch= Currently google and duckduckgo are supported Examples: SURFRAW_customsearch_provider=duckduckgo sr mysqldoc -v=5.5 select sr pgdoc -customsearch=google -v=9.1 select The default is to use duckduckgo. Currently affected elvi: mdn mysqldoc netbsd openbsd pgdoc slinuxdoc INSTALLATION Surfraw is installed with the standard ./configure; make; make install procedure. See INSTALL for more details. If you obtained surfraw direct from the git repository rather than a release tarball, run ./prebuild to generate the autotools build files *before* running ./configure. Note that the opensearch elvis depends on the perl libraries WWW::OpenSearch, HTML::Parser and LWP (libwww-perl). If you don't want to install opensearch, use ./configure --disable-opensearch. Surfraw supports the following options to ./configure: --with-text-browser=BROWSER Use BROWSER as text-mode browser --with-graphical-browser=BROWSER Use BROWSER as graphical-mode browser --with-elvidir=DIR Use DIR as location for storing elvi --disable-opensearch Disable OpenSearch support --disable-sr Disable installing sr alias By default, the text and graphical browsers are detected from a list of installed browsers at configure time. elvidir defaults to $(libdir)/surfraw (probably /usr/local/lib/surfraw). EXAMPLES $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr wikipedia surfraw $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian OPTIONS Global options are common to all Surfraw elvi (clients). You can get a list of the currently installed elvi by just typing `surfraw -elvi'. For example: $ surfraw -elvi GLOBAL ELVI: W -- Activate Surfraw defined web-browser acronym -- Look for acronyms definitions (www.acronymfinder.com) ads -- Search SAO/NASA Astrophysics Data System alioth -- Search Alioth (alioth.debian.org) amazon -- Search the amazon.com bookstore archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/) archwiki -- Search the Arch Linux Wiki arxiv -- Search arXiv E-Print Archive for articles ask -- Question the web using Ask Jeeves (www.ask.com) aur -- Search aur.archlinux.org for PKGBUILDs austlii -- Search Australian Law docs (www.austlii.edu.au) bbcnews -- Search BBC News (news.bbc.co.uk) bing -- Search the web using Microsoft's Bing (www.bing.com) bookfinder -- Search for books using www.bookfinder.com bugmenot -- Bypass compulsory web registration with bugmenot.com bugzilla -- Search for bugs on Bugzilla bugtrackers cablesearch -- search for leaked diplomatic communications cia -- Search CIA documents at www.cia.gov cisco -- Search Cisco documentation (www.cisco.com) cite -- Search computer science papers (citeseerx.ist.psu.edu) cliki -- Search the common lisp wiki cnn -- Search on CNN (cnn.com) comlaw -- Search Australian Law using Comlaw (www.comlaw.gov.au) ctan -- Search the Comprehensive TeX Archive Network (ctan.org) currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) cve -- Search for CAN assignments in CVE debbugs -- Search the debian BTS (bugs.debian.org) debcodesearch -- Search debian source code debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) deblists -- Search debian mailing lists (lists.debian.org/search.html) deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net) debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) debpkghome -- Visit the home page for a Debian package debpts -- Search the Debian Package Tracking System (packages.qa.debian.org) debsec -- Search the Debian Security Tracker for CVE ids or package names debvcsbrowse -- Browse the VCS repository for a Debian package debwiki -- Search the Debian Wikis (wiki.debian.org & women.debian.org/wiki) deja -- Search usenet using Google Groups (groups.google.com) deli -- Search Delicious bookmarks discogs -- Search the Discogs database of music information (www.discogs.com) dmoz -- Search the Open Directory Project web directory (dmoz.org) duckduckgo -- Securely search the web using duckduckgo (www.duckduckgo.com) ebay -- Search the Ebay auction site etym -- Look up word origins at www.etymonline.com excite -- Search on Excite (www.excite.com) f5 -- Search F5 related information (www.f5.com) finkpkg -- Search Fink packages (pdb.finkproject.org) foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org) freebsd -- Search FreeBSD related information (www.freebsd.org) freedb -- Search for cd track listings in FreeDB (www.freedb.org) freshmeat -- Search Freshmeat (www.freshmeat.net) fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org) gcache -- Search the web using Google cache (www.google.com) genbugs -- Search the Gentoo bug tracker (bugs.gentoo.org) genportage -- Search gentoo-portage.com for packages github -- Search GitHub (https://github.com) gmane -- Search mailing list with gmane (gmane.org) google -- Search the web using Google (www.google.com) gutenberg -- Search for books on Project Gutenberg (gutenberg.org) imdb -- Search the Internet Movie Database (www.imdb.com) ixquick -- Search the web using ixquick [HTTPS] (www.ixquick.com) jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) javasun -- Search Java API docs (java.sun.com) jquery -- Search the jQuery documentation (api.jquery.com) l1sp -- Search lisp documentation lastfm -- Search last.fm leodict -- Search Leo's German <-> English dictionary (dict.leo.org) lsm -- Search the Linux Software Map macports -- Search macports packages (macports.org) mathworld -- Search Wolfram MathWorld mdn -- Search the mozilla developer network (developer.mozilla.org) mininova -- Search the mininova bittorent source. musicbrainz -- Search MusicBrainz (musicbrainz.org) mysqldoc -- Search mysql documentation (dev.mysql.com) netbsd -- Search NetBSD related information (www.netbsd.org) +nlab -- Search the nLab wiki (http://ncatlab.org) ntrs -- Search the NASA Technical Report Server openbsd -- Search OpenBSD related information (www.openbsd.org) openports -- search openports for OpenBSD packages opensearch -- Search an OpenSearch-enabled website oraclesearch -- Search an OpenSearch-enabled website pasearch -- Search the unofficial Penny Arcade archives (pipefour.org/pa) pgdoc -- Search postgres documentation (www.pgdoc.com) pgpkeys -- Search the PGP key database phpdoc -- Search php documentation (php.net) pin -- Search Pinboard bookmarks (http://pinboard.in) piratebay -- Search The Pirate Bay (http://thepiratebay.org) priberam -- Look up word in Priberam online dictionary (www.priberam.pt/dlpo) pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov) rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) rfc -- Search RFCs (internet standards documents) rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com) rpmsearch -- Search for RPMs in various distros scholar -- Search Google Scholar (scholar.google.com) scicom -- Search Scientific Commons scirus -- Search for science using Scirus (scirus.com) scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org) slashdot -- Search stories on Slashdot (www.slashdot.org) slinuxdoc -- Search entries in LDP (www.linuxdoc.org) sourceforge -- Search SourceForge (www.sourceforge.net) springer -- Search Springer for Books and Articles stack -- Search Stack Overflow stockquote -- Get a single stock quote (multiple providers) thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com) translate -- Translate human languages urban -- Search urbandictionary.com for a definition w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) w3html -- Validate a web page URL with the w3c validator (validator.w3.org) w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org) webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com) wetandwild -- Real time weather information (many sources) wikipedia -- Search the free encyclopedia wikipedia woffle -- Search the web using Woffle (localhost:8080) wolfram -- Ask questions of the computational knowledge engine worldwidescience -- Search for science with www.worldwidescience.org yacy -- Search YaCy P2P search, including ScienceNet yahoo -- Search Yahoo categories (www.yahoo.com) yandex -- Search the web using Yandex (yandex.ru) youtube -- Search YouTube (www.youtube.com) yubnub -- Use the social command-line for the web (yubnub.org) All elvi have useful low calorie help, for example: Usage: rhyme [options] [search words]... Description: Surfraw search for rhymes and other word correlations using Lycos Rhyme (rhyme.lycos.com) Example: $ rhyme Julian $ rhyme -method=rel surfer Results: Hurclean St. Julien. surfboarder, bather, natator, swimmer Local options: -method= Type of word correlation to search for prefect | Perfect rhyme syn | Synonyms hom | Homophones cons | Consonsant rhymes only rel | Semantically related words sub | Phrases spell | Similar spellings pic | Pictures shake | Match with Shakespeare archives def Find wordnet definition Default: perfect Environment: SURFRAW_rhyme_method Global options: -browser=EXECUTABLE Set browser Default: sensible-browser -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: yes Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: yes Environment: SURFRAW_graphical -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: no Environment: SURFRAW_new_window -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: no Environment: SURFRAW_quote_args -version Display Surfraw version (2.2.7) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study If you just want to see the elvi-specific help, use elvi -lh or -local-help. The system wide configuration file can usually be found in /etc/xdg/surfraw/conf (but see 'Config files' above). This can be overridden by setting the environment variable SURFRAW_global_conf. Each user can also specify their own overrides, usually in $HOME/.config/surfraw/conf (again, see 'Config files' above). This can be overridden by setting SURFRAW_conf, either in the environment or the global config file. e.g SURFRAW_graphical_remote=yes SURFRAW_graphical_browser=mozilla SURFRAW_text_browser=w3m SURFRAW_pgpkeys_sigs=on INTEGRATION There is a browser plugin for Pentadactyl (a vimperator fork) at http://code.google.com/p/dactyl/issues/detail?id=320 For details, see: http://lists.alioth.debian.org/pipermail/surfraw-devel/2011-April/000916.html Code to integrate with uzbl is in examples/uzbl_load_url_from_surfraw RADICALIZATION Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on [email protected] _________________________________________________________________ README originally by Julian Assange Updated by Ian Beckwith _________________________________________________________________ See NEWS, and ChangeLog for a summary of changes. _________________________________________________________________ diff --git a/elvi/Makefile.am b/elvi/Makefile.am index 91df891..b0345bc 100644 --- a/elvi/Makefile.am +++ b/elvi/Makefile.am @@ -1,129 +1,130 @@ # $Id$ elvidir=$(ELVIDIR) dist_elvi_SCRIPTS = \ S \ W \ acronym \ ads \ alioth \ amazon \ archpkg \ archwiki \ arxiv \ ask \ aur \ austlii \ bing \ bbcnews \ bookfinder \ bugmenot \ bugzilla \ cablesearch \ cia \ cisco \ cite \ cliki \ cnn \ comlaw \ ctan \ currency \ cve \ debbugs \ debcodesearch \ debcontents \ deblists \ deblogs \ debpackages \ debpkghome \ debpts \ debsec \ debvcsbrowse \ debwiki \ deja \ deli \ discogs \ dmoz \ duckduckgo \ ebay \ etym \ excite \ f5 \ foldoc \ finkpkg \ freebsd \ freedb \ freshmeat \ fsfdir \ gcache \ genbugs \ genportage \ github \ gmane \ google \ gutenberg \ imdb \ ixquick \ jamendo \ javasun \ jquery \ l1sp \ lastfm \ leodict \ lsm \ macports \ mathworld \ mdn \ mininova \ musicbrainz \ mysqldoc \ netbsd \ + nlab \ ntrs \ openbsd \ openports \ opensearch \ oraclesearch \ pasearch \ pgdoc \ pgpkeys \ phpdoc \ pin \ piratebay \ priberam \ pubmed \ rae \ rfc \ rhyme \ rpmsearch \ scholar \ scicom \ scirus \ scpan \ slashdot \ slinuxdoc \ sourceforge \ springer \ stack \ stockquote \ thesaurus \ translate \ urban \ w3css \ w3html \ w3link \ w3rdf \ wayback \ webster \ wetandwild \ wikipedia \ woffle \ wolfram \ worldwidescience \ yacy \ yahoo \ yandex \ youtube \ yubnub uninstall-local: -rmdir $(DESTDIR)$(PREFIX)/$(ELVIDIR)
JNRowe/surfraw
27892d72e263625e93c729c6111c5330e61fc278
debian: bump standards-version to 3.9.5
diff --git a/debian/changelog b/debian/changelog index b4f4c10..11e9e70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,518 +1,518 @@ surfraw (2.2.9-1) unstable; urgency=low * New upstream version + yandex: Fix bashism (Closes: #690615). + rae: Fix URL (Closes: #680138). - * Standards-Version: 3.9.4 (no changes). + * Standards-Version: 3.9.5 (no changes). * update debian/copyright. * switch to source format 3.0 (quilt). * update Vcs-Browser fields. -- Ian Beckwith <[email protected]> Tue, 10 Dec 2013 17:03:19 +0000 surfraw (2.2.8-1) unstable; urgency=low * New upstream version + SURFRAW_graphical_remote defaults to off, as chromium doesn't support '-remote openURL()' (Closes: #628683). * Move opensearch elvi to main surfraw package. It now has an optional mode that uses a redirector if the dependencies are not installed. * debian/rules: + hardcode AWK as awk (Closes: #608967). + use dh_prep instead of dh_clean -k. + add build-arch and build-indep targets. * debian/control: + Build-Depends: bump debhelper dependency to (>= 7). + Standards-Version: 3.9.2. + surfraw-extra: convert Conflicts: to Breaks:. + surfraw: * Breaks: surfraw-extra (<= 2.2.7-1) as we have taken over /usr/lib/surfraw/opensearch. * Recommends: surfraw-extra: add version of (>> 2.2.7-1). * Tweak Description. * debian/source/format: explicitly specify 1.0 source format. -- Ian Beckwith <[email protected]> Tue, 12 Jul 2011 01:31:52 +0100 surfraw (2.2.7-1) unstable; urgency=low * New upstream version. + fixed imdb elvi (Closes: #577263). * Standards-Version: 3.8.4 (no changes). * Add ${misc:Depends} to dependencies. -- Ian Beckwith <[email protected]> Fri, 16 Apr 2010 20:43:27 +0100 surfraw (2.2.6-1) unstable; urgency=low * New upstream version. + Only use first matching bookmark (Closes: #530786). + Fix debsec (patch from Moritz Muehlenhoff) (Closes: #550741). * Remove Moritz from Uploaders (per #550741), thanks for your work!. * debian/rules: call dh_installexamples to install examples/ dir. * debian/control: + update vcs- fields to point to new git repo. + Standards-Version: 3.8.3 (No changes). + add Recommends: curl | wget | libwww-perl for -o. + Remove Conflicts/Replaces: surfaw, this transition was complete many releases ago. -- Ian Beckwith <[email protected]> Fri, 20 Nov 2009 03:34:34 +0000 surfraw (2.2.5-1) unstable; urgency=low * New upstream version. * Removed Thomas Smith from Uploaders (Closes: #519378). Thanks for your work!. * Updated my email address in Uploaders. * Fixed VCS-Browser URL (Closes: #528299). * Removed DM-Upload-Allowed header. * Standards-Version: 3.8.1 (no changes). -- Ian Beckwith <[email protected]> Wed, 13 May 2009 02:09:49 +0100 surfraw (2.2.4-1) unstable; urgency=low * New upstream version. * postrm: add 'set -e'. * debian/copyright: + Update copyright years to include 2009. + point to right GPL link (NB only the file 'missing' is GPLed, most of the package is PD). -- Ian Beckwith <[email protected]> Sun, 01 Mar 2009 02:30:59 +0000 surfraw (2.2.3-1) unstable; urgency=low * New upstream version. + Now defaults to graphical mode, see surfraw(1) for how to change it back. * Change default text browser to www-browser and default graphical browser to sensible-browser. -- Ian Beckwith <[email protected]> Tue, 26 Aug 2008 22:36:24 +0100 surfraw (2.2.2-3) unstable; urgency=low * Backport slinuxdoc fix from 2.2.3 prerelease. -- Ian Beckwith <[email protected]> Fri, 25 Jul 2008 05:14:30 +0100 surfraw (2.2.2-2) unstable; urgency=medium * google: fix bashism and quote more variable expansions (Closes: #489902). Thanks to Philip Armstrong and John Briggs. * Reformat debian/copyright to keep lintian happy. -- Ian Beckwith <[email protected]> Sat, 19 Jul 2008 00:50:33 +0100 surfraw (2.2.2-1) unstable; urgency=low * New upstream version: + fix url escaping (Closes: #487430). + surfraw-update-path: fix csh support (Closes: #484871). * Recommends: Drop w3m-ssl (folded into w3m) and lynx-cur (not in lenny) (Closes: #471359). * surfraw-extra: improve long description (Closes: #471321). * Standards-Version: 3.8.0 (no changes). * Remove linda override. * Add watch file. -- Ian Beckwith <[email protected]> Thu, 03 Jul 2008 01:22:36 +0100 surfraw (2.2.1-2) unstable; urgency=low * Remove my old email address from Uploaders. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:35 +0000 surfraw (2.2.1-1) unstable; urgency=low * New upstream release. + bashisms removed (Closes: #465361, #468139). * debian/rules: move .deb building to binary-indep: target. * debian/compat: bump to 6. * debian/control: + DM-Upload-Allowed: yes merged from Debian-only 2.1.7-1 (see below). Dropped XS- prefix, no longer needed. + Recommends: add elinks | elinks-lite to existing browser alternatives. + Uploaders: update my email address. + Standards-Version: 3.7.3 (no changes). + Build-Depends: Bump debhelper version to >= 6. + Vcs-Cvs/Vcs-Browser: remove XS- prefix and -d workaround. + Homepage: added. * debian/changelog: merged Moritz's debian-only 2.1.7 release changelog. * debian/linda.overrides: remove exec-not-elf-or-script tag now file(1) is fixed. * debian/copyright: update, use machine-interpretable format. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:08 +0000 surfraw (2.2.0-1) UNRELEASED; urgency=low * Actual first new upstream release. See changelog.gz for upstream changes, like a normal package. * debian/rules: Use $(CURDIR) instead of `pwd`. * debian/copyright: updated copyright dates. -- Ian Beckwith <[email protected]> Tue, 11 Sep 2007 03:41:09 +0100 surfraw (2.1.8-1) UNRELEASED; urgency=low * First proper upstream release of the surfraw-devel version. After this release non-debian changes will be logged in the upstream changelog.gz. * Split off opensearch into new package: surfraw-extra as it has a huge dependency tree that not everyone will want to install. * Fixed "sr -options bookmark" (excessive quoting). * New elvi: + archpkg - search Arch Linux packages. Thanks to Simon Ernst. + port - look up a TCP/UDP port on seifried.org/security/ports. * Fixed elvi + debbugs: fixed help formatting. + debcontents - new options * Fixed tests: + austlii - (since when does a legal db not contain "tort"?). + deblists - -security-announce not indexed (#440347), so we search for WNPP posts on -devel. + debpackages. + sunsolve - added cookie to accept license. + w3html - validator will not validate itself. * runtests (see test/README): + Added cookie support. + Added support for skipping tests with SKIP. + Abort if libwww-perl not installed. + Documented changes in test/README. * Makefile.am: removed debian/ files from EXTRA_DIST, they should be in the debian patch not the main tarball. * Bumped debhelper compat level to 5. * Really updated to automake-1.10. * Updated AUTHORS, NEWS, README, HACKING, ChangeLog, NEWS.Debian. -- Ian Beckwith <[email protected]> Fri, 07 Sep 2007 00:18:38 +0100 surfraw (2.1.7) unstable; urgency=low * Add "XS-DM-Upload-Allowed: yes", so that Ian can upload further updates on his own. -- Moritz Muehlenhoff <[email protected]> Sun, 13 Jan 2008 23:23:30 +0100 surfraw (2.1.6) unstable; urgency=low * New elvi: + codesearch - search google code search. + debwiki - search wiki.debian.org and women.debian.org/wiki. + lastfm - search last.fm. + musicbrainz - search musicbrainz.org. + opensearch - search sites that provide an OpenSearch description: - Install helper scripts opensearch-discover and opensearch-genquery to /usr/bin. - Add Dependencies on libwww-opensearch-perl, libwww-perl and libhtml-parser-perl. - Makefile.am: replaced explicit rule for surfraw-update-path.1 with a static pattern rule for making man pages from perl scripts. * Fixed elvi: + amazon - fixed example usage. + cia - switched to https. + cite - fixed URL and options. + debpackages - updated ubuntu distro names. + debcontents - updated ubuntu distro names. + freebsd - fixed help formatting. + netbsd - fixed mailing list searches. + openbsd - fixed PR search URL. + slinuxdoc - fixed URLs. + sundocs - fixed URLs. + woffle - updated URLs to match woffle 2.9a. * Removed elvi: jake - site shut down January 2007. * Implemented test suite - 'make test' or see test/README. * Fixed make distcheck. * Updated to automake 1.10. * debian/rules: stopped ignoring return code of 'make distclean'. * Updated Copyright dates to 2007. * Add Vcs-Cvs and Vcs-Browser fields to debian/control. -- Ian Beckwith <[email protected]> Sat, 30 Jun 2007 22:15:14 +0100 surfraw (2.1.5) unstable; urgency=low * Added myself to Uploaders. * Ack not-really-NMU (Closes: #354737). * Applied bash completion fixes, thanks to Justin B. Rye (Closes: #361668). * wikipedia: disable requoting; use Go rather than Search. * Fixes to ixquick elvi, thanks to Aparna Jaitly. * debpackages/debcontents: new options + ubuntu support with -u. * New elvi: scholar - search google scholar. * New elvi: discogs, thanks to Patroklos Argyroudis. * Thanks to James Rowe for the following patches: + Move W to /usr/lib/surfraw (see http://bugs.gentoo.org/show_bug.cgi?id=58955). + New elvi: genpkg for Gentoo package search. + Generate elvi list on demand and eliminate surfraw_elvi.list + Make elvidir configurable. + Make sysconfdir configurable. + Fix 'make dist' and 'make distcheck'. + Remove unused browser checks. + Drop AC_CANONICAL_HOST - not needed. * New global option: -p / -print: just print search url. * Remove config.guess and config.sub - not needed. * Remove config.{guess,sub} updating logic from debian/rules. * postrm: remove /etc/surfraw_elvi.list if it exists. * Convert debhelper Build-Depends-Indep: to Build-Depends:. * Standards-Version: 3.7.2 (No changes). * Updated Copyright dates to 2006. * Added linda override exec-not-elf-or-script for /usr/bin/surfraw due to erroneous file(1) output (See: #369977). * Tweak HACKING appendix 1 to remove need to build surfraw_elvi.list. -- Ian Beckwith <[email protected]> Tue, 26 Sep 2006 04:22:53 +0100 surfraw (2.1.4) unstable; urgency=low * Ian Beckwith <[email protected]>: + changed elvi: - debsec: fix tabbing (Closes: #354737). - debbugs: updated search options. + new elvi: - ixquick (Thanks to Aparna Jaitly). - ctan. - fsfdir. - gutenberg. - wayback. + Makefile.include: changed sed invocation to work with both old and new make(1). + debian/rules install: removed spurious mkdir. + removed debian/{prerm,postinst}. + Switched to debhelper compat level 4. + HACKING: corrected appendix 1. -- Ian Beckwith <[email protected]> Fri, 17 Mar 2006 22:26:37 +0000 surfraw (2.1.3) unstable; urgency=high * Urgency high, as it renders surfraw uninstallable * Really, really remove debconfage (Closes: #354263) -- Moritz Muehlenhoff <[email protected]> Fri, 24 Feb 2006 23:00:09 +0100 surfraw (2.1.2) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Fix FTBFS due to make changes (Patch by Matt Kraai) (Closes: 353314) + Fix zsh completion for yubnub (Patch by Micah Anderson) (Closes: #341872) + Remove debian/po to prevent further translations in vain. Sorry for the wasted work on the Swedish translation, Daniel Nylander! (Closes: #338149, #336687) + Changed maintainer address to "Debian surfraw maintainers", added Christian, Thomas and myself to uploaders + New elvis: debsec (for the Debian security tracker) -- Moritz Muehlenhoff <[email protected]> Thu, 23 Feb 2006 16:49:55 +0100 surfraw (2.1.1) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Removed debconf information about new elvi structure, now that Sarge has been released with it. Moved it to README.Debian. (Closes: #313852, #312979, #319841, #319842) + New elvis: yubnub (by Iain D Broadfoot) (Closes: #315188) + Removed unused SURFRAW_p0rn option (Closes: #324166) + Bumped standards version (no changes required) + Change to a native package, most of the elvis are now more or less Debian specific anyway -- Moritz Muehlenhoff <[email protected]> Fri, 29 Apr 2005 16:20:39 +0200 surfraw (2.1.0-1) unstable; urgency=medium * Ian Beckwith <[email protected]>: + New elvi: dmoz, w3html, w3link, w3css, w3rdf. + New elvi: rae (by Ruben Pollan <[email protected]>). + surfraw.IN:w3_url_escape: escaped `(' and `)'. + Fixed elvi (Thanks to Justin B. Rye): - sunsolve (Closes: #289502). - altavista (Closes: #289503). + deblists: Updated list of debian mailing lists. + currency: Now a proper elvis. + Added appendix 2 to HACKING on preparing a release. * Moritz Muehlenhoff <[email protected]>: + Switch rhymes search from Lycos to Rhymezone (by Justin B Rye) (Closes: #289498) + Fix BBC News search (by Justin B Rye) (Closes: #289499) + New elvi by by Justin B Rye (Closes: #290032) - cia Search for CIA documents - deblogs Debian changelogs - etym Search for word origins - foldoc Free online dictionary of computing + New cve elvis for CAN assignment searches + Rewrite debian/copyright properly -- Thomas Smith <[email protected]> Wed, 20 Apr 2005 17:00:59 -0500 surfraw (2.0.2-2) unstable; urgency=low * Applied Brian Mcdonald's workaround for bash bug (Closes: #269982) -- Christian Surchi <[email protected]> Mon, 13 Sep 2004 16:34:53 +0100 surfraw (2.0.2-1) unstable; urgency=low * Several patches from Justin B Rye: + Add bash completion (Closes: #240629) + Add some missing elvis in surfraw_elvi.list (Closes: #241079) + Don't set DISPLAY when in text-only mode (Closes: #235251) + Correctly test for text-mode in w3_browse_url() + Readability improvements + Use argv[0] instead of computing it through basename * Removed elvi: + sharereactor: has been closed down * Added French debconf template by Christian Perrier (Closes: #236088) * Added German debconf template by Helge Kreutzmann (Closes: #253800) * New elvi: debpts. * man page hyphenation fixes. * debian/control: + Dropped optional last part of Standards-Version. + Changed lynx to lynx-cur in Recommends to avoid confusing apt. + Added po-debconf to Build-Depends-Indep. * debian/rules clean: + enabled config.{guess,sub} update. + remove templates.merged. * HACKING: updated Appendix 1. * surfraw.conf.in: set SURFRAW_graphical_browser to x-www-browser (Closes: #256201) -- Ian Beckwith <[email protected]> Thu, 29 Jul 2004 15:31:10 +0100 surfraw (2.0.1-1) unstable; urgency=low * Moved elvi to /usr/lib/surfraw (Closes: #230276) * Updated docs for new elvi location * Changed man page section for all elvi to 1sr (Closes: #230056) * Fixed surfraw help text (Closes: #230109) * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Updated README with text from new man page. * Added "Copyright (c) 2003, 2004 The Surfraw-Devel Team <[email protected]>" to the list of copyright holders. * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again. * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them (Closes: #231939). * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * Added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * Disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * Synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf -- Ian Beckwith <[email protected]> Tue, 10 Feb 2004 03:33:14 +0000 surfraw (2.0-1) unstable; urgency=low * Ack NMUs. (Closes: #200164, #201229, #209155, #113148, #119357, #131661) * ..and.. (Closes: #149584, #156466, #141243, #154304, #164206, #141242) * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and ebay, pgpkeys and sharereactor, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Closing non-bugs: - Complaint about correct behaviour (Closes: #173714). - Adds functionality already present in debcontents (Closes: #144080). - Obsoleted by sensible-browser (imho) (Closes: #155423). -- Ian Beckwith <[email protected]> Sun, 9 Nov 2003 22:02:44 +0000 surfraw (1.0.7-3) unstable; urgency=low * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. -- Thomas Smith <[email protected]> Thu, 4 Sep 2003 18:09:29 -0500 surfraw (1.0.7-2) unstable; urgency=low * The first "collaborative" release :) * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* -- Christian Surchi <[email protected]> Sat, 16 Aug 2003 17:02:03 +0000 surfraw (1.0.7-1) unstable; urgency=low * New upstream release * New debian/rules with DH_COMPAT=3 too * Elvi: linuxdoc renamed to slinuxdoc translate renamed to stranslate * Removed unuseful scripts in debian directory * Removed emacs settings in changelog -- Christian Surchi <[email protected]> Sat, 2 Mar 2002 23:54:34 +0100 surfraw (1.0.4-1) unstable; urgency=low * New upstream release, surfraw becomes public domain * Support "--" option to end all options (Closes:#113429) * Added elvi for Debian bugs search (Closes:#70109) diff --git a/debian/control b/debian/control index 6f7df9b..993c998 100644 --- a/debian/control +++ b/debian/control @@ -1,66 +1,66 @@ Source: surfraw Section: web Priority: optional Maintainer: Debian surfraw maintainers <[email protected]> Uploaders: Christian Surchi <[email protected]>, Ian Beckwith <[email protected]> -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Build-Depends: debhelper (>= 7) Vcs-Git: git://anonscm.debian.org/surfraw/surfraw.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=surfraw/surfraw.git Homepage: http://surfraw.alioth.debian.org Package: surfraw Architecture: all Depends: ${misc:Depends}, lynx | www-browser Recommends: surfraw-extra (>> 2.2.7-1), links | elinks | elinks-lite | w3m, curl | wget | libwww-perl Breaks: surfraw-extra (<= 2.2.7-1) Suggests: screen Description: fast unix command line interface to WWW Surfraw - Shell Users' Revolutionary Front Rage Against the World Wide Web . Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. . Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with incremental text browsers, such as links, w3m (or even lynx), and screen(1), or netscape-remote a Surfraw liberateur is capable of research speeds that leave GUI tainted idolaters agape with fear and wonder. Package: surfraw-extra Architecture: all Depends: surfraw, ${misc:Depends}, lynx | www-browser, libwww-opensearch-perl, libwww-perl, libhtml-parser-perl Recommends: links | elinks | elinks-lite | w3m | w3m-ssl | lynx-cur Suggests: screen Breaks: surfraw (<< 2.1.7) Description: extra surfraw search tools with heavy dependencies surfraw-extra contains extra website search tools for surfraw that have large dependency trees. Currently surfraw-extra only contains support tools for the opensearch elvi: . opensearch-discover - find an opensearch link from a URL. opensearch-genquery - construct a search URL from an opensearch description . Surfraw - Shell Users' Revolutionary Front Rage Against the World Wide Web . Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. . Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with incremental text browsers, such as links, w3m (or even lynx), and screen(1), or netscape-remote a Surfraw liberateur is capable of research speeds that leave GUI tainted idolaters agape with fear and wonder.
JNRowe/surfraw
f2e685481b89fd381cc59e2271350f8fe3ddf9ed
Fix make distcheck: remove last traces of codesearch and scitopia.
diff --git a/ChangeLog b/ChangeLog index d05c214..e6a3e22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,515 +1,516 @@ 2013-12-10 Ian Beckwith <[email protected]> * yandex: disabled test: redirects to captcha when used with LWP. + * Fix make distcheck: remove last traces of codesearch and scitopia. 2013-12-09 Ian Beckwith <[email protected]> * deja: disable tests, google groups now requires javascript. * gmane: fix test. * codesearch: removed, service shut down. * scitopia: removed, service shut down. * scicom: down, status unknown, made note in NEWS. 2013-12-08 Ian Beckwith <[email protected]> * new elvi: gmane * openbsd -mail: use gmane (directly, not via gmane elvi) * fix tests: ads, pgdoc, pin, yacy 2013-10-27 Ian Beckwith <[email protected]> * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. * pgdoc, wayback: fixed tests. 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> diff --git a/README b/README index d311461..f02c097 100644 --- a/README +++ b/README @@ -1,401 +1,399 @@ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Home Page: http://surfraw.alioth.debian.org ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web New: http://surfraw.alioth.debian.org Old: http://surfraw.sourceforge.net/ Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, babelfish, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with netscape-remote or incremental text browsers, such as links (http://artax.karlin.mff.cuni.cz/~mikulas/links/), w3m (http://www.w3m.org/), and screen(1) a Surfraw liberateur is capable of navigating speeds that leave GUI tainted idolaters agape with fear and wonder. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine. ADDING THE ELVI TO YOUR PATH If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (usually /usr/lib/surfraw or /usr/local/lib/surfraw/) to your path, either manually or using surfraw-update-path(1). CONFIG FILES Surfraw implements the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) Essentially this means global config will be in /etc/xdg/surfraw/ and local config will be in $HOME/.config/surfraw/. This can be modified by setting $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME, see the spec for more details. If your system has a different sysconfdir set during configure, that will be used instead of /etc (for instance, /usr/local/etc). In the documentation below, only the default paths will be referred to. LOCAL ELVI Surfraw can use your own private elvi, store them in $HOME/.config/surfraw/elvi/. Local elvi will be listed separately at the end of 'surfraw -elvi'. Use existing elvi (e.g. google) as a template. If you think your elvi may be useful to others, consider submitting them to [email protected]. BOOKMARKS Surfraw now supports bookmarks. To add a bookmark, add it to to the global bookmark list in /etc/xdg/surfraw/bookmarks or to your personal bookmark list in $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks CUSTOM SEARCH Several elvi use a search engine with site: and inurl: keywords. The search engine used can be customized by setting the environment variable SURFRAW_customsearch_provider or using the command-line argument -customsearch= Currently google and duckduckgo are supported Examples: SURFRAW_customsearch_provider=duckduckgo sr mysqldoc -v=5.5 select sr pgdoc -customsearch=google -v=9.1 select The default is to use duckduckgo. Currently affected elvi: mdn mysqldoc netbsd openbsd pgdoc slinuxdoc INSTALLATION Surfraw is installed with the standard ./configure; make; make install procedure. See INSTALL for more details. If you obtained surfraw direct from the git repository rather than a release tarball, run ./prebuild to generate the autotools build files *before* running ./configure. Note that the opensearch elvis depends on the perl libraries WWW::OpenSearch, HTML::Parser and LWP (libwww-perl). If you don't want to install opensearch, use ./configure --disable-opensearch. Surfraw supports the following options to ./configure: --with-text-browser=BROWSER Use BROWSER as text-mode browser --with-graphical-browser=BROWSER Use BROWSER as graphical-mode browser --with-elvidir=DIR Use DIR as location for storing elvi --disable-opensearch Disable OpenSearch support --disable-sr Disable installing sr alias By default, the text and graphical browsers are detected from a list of installed browsers at configure time. elvidir defaults to $(libdir)/surfraw (probably /usr/local/lib/surfraw). EXAMPLES $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr wikipedia surfraw $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian OPTIONS Global options are common to all Surfraw elvi (clients). You can get a list of the currently installed elvi by just typing `surfraw -elvi'. For example: $ surfraw -elvi GLOBAL ELVI: W -- Activate Surfraw defined web-browser acronym -- Look for acronyms definitions (www.acronymfinder.com) ads -- Search SAO/NASA Astrophysics Data System alioth -- Search Alioth (alioth.debian.org) amazon -- Search the amazon.com bookstore archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/) archwiki -- Search the Arch Linux Wiki arxiv -- Search arXiv E-Print Archive for articles ask -- Question the web using Ask Jeeves (www.ask.com) aur -- Search aur.archlinux.org for PKGBUILDs austlii -- Search Australian Law docs (www.austlii.edu.au) bbcnews -- Search BBC News (news.bbc.co.uk) bing -- Search the web using Microsoft's Bing (www.bing.com) bookfinder -- Search for books using www.bookfinder.com bugmenot -- Bypass compulsory web registration with bugmenot.com bugzilla -- Search for bugs on Bugzilla bugtrackers cablesearch -- search for leaked diplomatic communications cia -- Search CIA documents at www.cia.gov cisco -- Search Cisco documentation (www.cisco.com) cite -- Search computer science papers (citeseerx.ist.psu.edu) cliki -- Search the common lisp wiki cnn -- Search on CNN (cnn.com) -codesearch -- Search source code using Google Code Search (www.google.fr/codesearch) comlaw -- Search Australian Law using Comlaw (www.comlaw.gov.au) ctan -- Search the Comprehensive TeX Archive Network (ctan.org) currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) cve -- Search for CAN assignments in CVE debbugs -- Search the debian BTS (bugs.debian.org) debcodesearch -- Search debian source code debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) deblists -- Search debian mailing lists (lists.debian.org/search.html) deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net) debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) debpkghome -- Visit the home page for a Debian package debpts -- Search the Debian Package Tracking System (packages.qa.debian.org) debsec -- Search the Debian Security Tracker for CVE ids or package names debvcsbrowse -- Browse the VCS repository for a Debian package debwiki -- Search the Debian Wikis (wiki.debian.org & women.debian.org/wiki) deja -- Search usenet using Google Groups (groups.google.com) deli -- Search Delicious bookmarks discogs -- Search the Discogs database of music information (www.discogs.com) dmoz -- Search the Open Directory Project web directory (dmoz.org) duckduckgo -- Securely search the web using duckduckgo (www.duckduckgo.com) ebay -- Search the Ebay auction site etym -- Look up word origins at www.etymonline.com excite -- Search on Excite (www.excite.com) f5 -- Search F5 related information (www.f5.com) finkpkg -- Search Fink packages (pdb.finkproject.org) foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org) freebsd -- Search FreeBSD related information (www.freebsd.org) freedb -- Search for cd track listings in FreeDB (www.freedb.org) freshmeat -- Search Freshmeat (www.freshmeat.net) fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org) gcache -- Search the web using Google cache (www.google.com) genbugs -- Search the Gentoo bug tracker (bugs.gentoo.org) genportage -- Search gentoo-portage.com for packages github -- Search GitHub (https://github.com) gmane -- Search mailing list with gmane (gmane.org) google -- Search the web using Google (www.google.com) gutenberg -- Search for books on Project Gutenberg (gutenberg.org) imdb -- Search the Internet Movie Database (www.imdb.com) ixquick -- Search the web using ixquick [HTTPS] (www.ixquick.com) jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) javasun -- Search Java API docs (java.sun.com) jquery -- Search the jQuery documentation (api.jquery.com) l1sp -- Search lisp documentation lastfm -- Search last.fm leodict -- Search Leo's German <-> English dictionary (dict.leo.org) lsm -- Search the Linux Software Map macports -- Search macports packages (macports.org) mathworld -- Search Wolfram MathWorld mdn -- Search the mozilla developer network (developer.mozilla.org) mininova -- Search the mininova bittorent source. musicbrainz -- Search MusicBrainz (musicbrainz.org) mysqldoc -- Search mysql documentation (dev.mysql.com) netbsd -- Search NetBSD related information (www.netbsd.org) ntrs -- Search the NASA Technical Report Server openbsd -- Search OpenBSD related information (www.openbsd.org) openports -- search openports for OpenBSD packages opensearch -- Search an OpenSearch-enabled website oraclesearch -- Search an OpenSearch-enabled website pasearch -- Search the unofficial Penny Arcade archives (pipefour.org/pa) pgdoc -- Search postgres documentation (www.pgdoc.com) pgpkeys -- Search the PGP key database phpdoc -- Search php documentation (php.net) pin -- Search Pinboard bookmarks (http://pinboard.in) piratebay -- Search The Pirate Bay (http://thepiratebay.org) priberam -- Look up word in Priberam online dictionary (www.priberam.pt/dlpo) pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov) rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) rfc -- Search RFCs (internet standards documents) rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com) rpmsearch -- Search for RPMs in various distros scholar -- Search Google Scholar (scholar.google.com) scicom -- Search Scientific Commons scirus -- Search for science using Scirus (scirus.com) -scitopia -- Search for science with scitopia.org scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org) slashdot -- Search stories on Slashdot (www.slashdot.org) slinuxdoc -- Search entries in LDP (www.linuxdoc.org) sourceforge -- Search SourceForge (www.sourceforge.net) springer -- Search Springer for Books and Articles stack -- Search Stack Overflow stockquote -- Get a single stock quote (multiple providers) thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com) translate -- Translate human languages urban -- Search urbandictionary.com for a definition w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) w3html -- Validate a web page URL with the w3c validator (validator.w3.org) w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org) webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com) wetandwild -- Real time weather information (many sources) wikipedia -- Search the free encyclopedia wikipedia woffle -- Search the web using Woffle (localhost:8080) wolfram -- Ask questions of the computational knowledge engine worldwidescience -- Search for science with www.worldwidescience.org yacy -- Search YaCy P2P search, including ScienceNet yahoo -- Search Yahoo categories (www.yahoo.com) yandex -- Search the web using Yandex (yandex.ru) youtube -- Search YouTube (www.youtube.com) yubnub -- Use the social command-line for the web (yubnub.org) All elvi have useful low calorie help, for example: Usage: rhyme [options] [search words]... Description: Surfraw search for rhymes and other word correlations using Lycos Rhyme (rhyme.lycos.com) Example: $ rhyme Julian $ rhyme -method=rel surfer Results: Hurclean St. Julien. surfboarder, bather, natator, swimmer Local options: -method= Type of word correlation to search for prefect | Perfect rhyme syn | Synonyms hom | Homophones cons | Consonsant rhymes only rel | Semantically related words sub | Phrases spell | Similar spellings pic | Pictures shake | Match with Shakespeare archives def Find wordnet definition Default: perfect Environment: SURFRAW_rhyme_method Global options: -browser=EXECUTABLE Set browser Default: sensible-browser -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: yes Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: yes Environment: SURFRAW_graphical -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: no Environment: SURFRAW_new_window -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: no Environment: SURFRAW_quote_args -version Display Surfraw version (2.2.7) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study If you just want to see the elvi-specific help, use elvi -lh or -local-help. The system wide configuration file can usually be found in /etc/xdg/surfraw/conf (but see 'Config files' above). This can be overridden by setting the environment variable SURFRAW_global_conf. Each user can also specify their own overrides, usually in $HOME/.config/surfraw/conf (again, see 'Config files' above). This can be overridden by setting SURFRAW_conf, either in the environment or the global config file. e.g SURFRAW_graphical_remote=yes SURFRAW_graphical_browser=mozilla SURFRAW_text_browser=w3m SURFRAW_pgpkeys_sigs=on INTEGRATION There is a browser plugin for Pentadactyl (a vimperator fork) at http://code.google.com/p/dactyl/issues/detail?id=320 For details, see: http://lists.alioth.debian.org/pipermail/surfraw-devel/2011-April/000916.html Code to integrate with uzbl is in examples/uzbl_load_url_from_surfraw RADICALIZATION Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on [email protected] _________________________________________________________________ README originally by Julian Assange Updated by Ian Beckwith _________________________________________________________________ See NEWS, and ChangeLog for a summary of changes. _________________________________________________________________ diff --git a/elvi/Makefile.am b/elvi/Makefile.am index 0bb99bb..91df891 100644 --- a/elvi/Makefile.am +++ b/elvi/Makefile.am @@ -1,131 +1,129 @@ # $Id$ elvidir=$(ELVIDIR) dist_elvi_SCRIPTS = \ S \ W \ acronym \ ads \ alioth \ amazon \ archpkg \ archwiki \ arxiv \ ask \ aur \ austlii \ bing \ bbcnews \ bookfinder \ bugmenot \ bugzilla \ cablesearch \ cia \ cisco \ cite \ cliki \ cnn \ - codesearch \ comlaw \ ctan \ currency \ cve \ debbugs \ debcodesearch \ debcontents \ deblists \ deblogs \ debpackages \ debpkghome \ debpts \ debsec \ debvcsbrowse \ debwiki \ deja \ deli \ discogs \ dmoz \ duckduckgo \ ebay \ etym \ excite \ f5 \ foldoc \ finkpkg \ freebsd \ freedb \ freshmeat \ fsfdir \ gcache \ genbugs \ genportage \ github \ gmane \ google \ gutenberg \ imdb \ ixquick \ jamendo \ javasun \ jquery \ l1sp \ lastfm \ leodict \ lsm \ macports \ mathworld \ mdn \ mininova \ musicbrainz \ mysqldoc \ netbsd \ ntrs \ openbsd \ openports \ opensearch \ oraclesearch \ pasearch \ pgdoc \ pgpkeys \ phpdoc \ pin \ piratebay \ priberam \ pubmed \ rae \ rfc \ rhyme \ rpmsearch \ scholar \ scicom \ - scitopia \ scirus \ scpan \ slashdot \ slinuxdoc \ sourceforge \ springer \ stack \ stockquote \ thesaurus \ translate \ urban \ w3css \ w3html \ w3link \ w3rdf \ wayback \ webster \ wetandwild \ wikipedia \ woffle \ wolfram \ worldwidescience \ yacy \ yahoo \ yandex \ youtube \ yubnub uninstall-local: -rmdir $(DESTDIR)$(PREFIX)/$(ELVIDIR) diff --git a/links.IN b/links.IN index 99c3530..9fc4dc3 100644 --- a/links.IN +++ b/links.IN @@ -1,120 +1,118 @@ elvi.1sr.gz @mandir@/man1/W.1.gz elvi.1sr.gz @mandir@/man1/S.1sr.gz elvi.1sr.gz @mandir@/man1/acronym.1sr.gz elvi.1sr.gz @mandir@/man1/ads.1sr.gz elvi.1sr.gz @mandir@/man1/alioth.1sr.gz elvi.1sr.gz @mandir@/man1/amazon.1sr.gz elvi.1sr.gz @mandir@/man1/archpkg.1sr.gz elvi.1sr.gz @mandir@/man1/archwiki.1sr.gz elvi.1sr.gz @mandir@/man1/arxiv.1sr.gz elvi.1sr.gz @mandir@/man1/ask.1sr.gz elvi.1sr.gz @mandir@/man1/aur.1sr.gz elvi.1sr.gz @mandir@/man1/austlii.1sr.gz elvi.1sr.gz @mandir@/man1/bing.1sr.gz elvi.1sr.gz @mandir@/man1/bbcnews.1sr.gz elvi.1sr.gz @mandir@/man1/bookfinder.1sr.gz elvi.1sr.gz @mandir@/man1/bugmenot.1sr.gz elvi.1sr.gz @mandir@/man1/bugzilla.1sr.gz elvi.1sr.gz @mandir@/man1/cablesearch.1sr.gz elvi.1sr.gz @mandir@/man1/cite.1sr.gz elvi.1sr.gz @mandir@/man1/cia.1sr.gz elvi.1sr.gz @mandir@/man1/cliki.1sr.gz elvi.1sr.gz @mandir@/man1/cnn.1sr.gz -elvi.1sr.gz @mandir@/man1/codesearch.1sr.gz elvi.1sr.gz @mandir@/man1/comlaw.1sr.gz elvi.1sr.gz @mandir@/man1/ctan.1sr.gz elvi.1sr.gz @mandir@/man1/currency.1sr.gz elvi.1sr.gz @mandir@/man1/cve.1sr.gz elvi.1sr.gz @mandir@/man1/debbugs.1sr.gz elvi.1sr.gz @mandir@/man1/debcodesearch.1sr.gz elvi.1sr.gz @mandir@/man1/debcontents.1sr.gz elvi.1sr.gz @mandir@/man1/deblists.1sr.gz elvi.1sr.gz @mandir@/man1/deblogs.1sr.gz elvi.1sr.gz @mandir@/man1/debpackages.1sr.gz elvi.1sr.gz @mandir@/man1/debpkghome.1sr.gz elvi.1sr.gz @mandir@/man1/debpts.1sr.gz elvi.1sr.gz @mandir@/man1/debsec.1sr.gz elvi.1sr.gz @mandir@/man1/debvcsbrowse.1sr.gz elvi.1sr.gz @mandir@/man1/debwiki.1sr.gz elvi.1sr.gz @mandir@/man1/deja.1sr.gz elvi.1sr.gz @mandir@/man1/deli.1sr.gz elvi.1sr.gz @mandir@/man1/discogs.1sr.gz elvi.1sr.gz @mandir@/man1/dmoz.1sr.gz elvi.1sr.gz @mandir@/man1/duckduckgo.1sr.gz elvi.1sr.gz @mandir@/man1/ebay.1sr.gz elvi.1sr.gz @mandir@/man1/etym.1sr.gz elvi.1sr.gz @mandir@/man1/excite.1sr.gz elvi.1sr.gz @mandir@/man1/finkpkg.1sr.gz elvi.1sr.gz @mandir@/man1/foldoc.1sr.gz elvi.1sr.gz @mandir@/man1/freebsd.1sr.gz elvi.1sr.gz @mandir@/man1/freedb.1sr.gz elvi.1sr.gz @mandir@/man1/freshmeat.1sr.gz elvi.1sr.gz @mandir@/man1/fsfdir.1sr.gz elvi.1sr.gz @mandir@/man1/gcache.1sr.gz elvi.1sr.gz @mandir@/man1/genbugs.1sr.gz elvi.1sr.gz @mandir@/man1/genportage.1sr.gz elvi.1sr.gz @mandir@/man1/github.1sr.gz elvi.1sr.gz @mandir@/man1/google.1sr.gz elvi.1sr.gz @mandir@/man1/gutenberg.1sr.gz elvi.1sr.gz @mandir@/man1/imdb.1sr.gz elvi.1sr.gz @mandir@/man1/ixquick.1sr.gz elvi.1sr.gz @mandir@/man1/jamendo.1sr.gz elvi.1sr.gz @mandir@/man1/javasun.1sr.gz elvi.1sr.gz @mandir@/man1/lastfm.1sr.gz elvi.1sr.gz @mandir@/man1/leodict.1sr.gz elvi.1sr.gz @mandir@/man1/l1sp.1sr.gz elvi.1sr.gz @mandir@/man1/lsm.1sr.gz elvi.1sr.gz @mandir@/man1/macports.1sr.gz elvi.1sr.gz @mandir@/man1/mathworld.1sr.gz elvi.1sr.gz @mandir@/man1/mdn.1sr.gz elvi.1sr.gz @mandir@/man1/mininova.1sr.gz elvi.1sr.gz @mandir@/man1/musicbrainz.1sr.gz elvi.1sr.gz @mandir@/man1/mysqldoc.1sr.gz elvi.1sr.gz @mandir@/man1/netbsd.1sr.gz elvi.1sr.gz @mandir@/man1/ntrs.1sr.gz elvi.1sr.gz @mandir@/man1/openbsd.1sr.gz elvi.1sr.gz @mandir@/man1/openports.1sr.gz elvi.1sr.gz @mandir@/man1/opensearch.1sr.gz elvi.1sr.gz @mandir@/man1/oraclesearch.1sr.gz elvi.1sr.gz @mandir@/man1/pasearch.1sr.gz elvi.1sr.gz @mandir@/man1/pgdoc.1sr.gz elvi.1sr.gz @mandir@/man1/pgpkeys.1sr.gz elvi.1sr.gz @mandir@/man1/phpdoc.1sr.gz elvi.1sr.gz @mandir@/man1/pin.1sr.gz elvi.1sr.gz @mandir@/man1/piratebay.1sr.gz elvi.1sr.gz @mandir@/man1/priberam.1sr.gz elvi.1sr.gz @mandir@/man1/pubmed.1sr.gz elvi.1sr.gz @mandir@/man1/rae.1sr.gz elvi.1sr.gz @mandir@/man1/rfc.1sr.gz elvi.1sr.gz @mandir@/man1/rhyme.1sr.gz elvi.1sr.gz @mandir@/man1/rpmsearch.1sr.gz elvi.1sr.gz @mandir@/man1/scholar.1sr.gz elvi.1sr.gz @mandir@/man1/scicom.1sr.gz -elvi.1sr.gz @mandir@/man1/scitopia.1sr.gz elvi.1sr.gz @mandir@/man1/scirus.1sr.gz elvi.1sr.gz @mandir@/man1/scpan.1sr.gz elvi.1sr.gz @mandir@/man1/slashdot.1sr.gz elvi.1sr.gz @mandir@/man1/slinuxdoc.1sr.gz elvi.1sr.gz @mandir@/man1/sourceforge.1sr.gz elvi.1sr.gz @mandir@/man1/springer.1sr.gz elvi.1sr.gz @mandir@/man1/stack.1sr.gz elvi.1sr.gz @mandir@/man1/stockquote.1sr.gz elvi.1sr.gz @mandir@/man1/thesaurus.1sr.gz elvi.1sr.gz @mandir@/man1/translate.1sr.gz elvi.1sr.gz @mandir@/man1/urban.1sr.gz elvi.1sr.gz @mandir@/man1/w3css.1sr.gz elvi.1sr.gz @mandir@/man1/w3html.1sr.gz elvi.1sr.gz @mandir@/man1/w3link.1sr.gz elvi.1sr.gz @mandir@/man1/w3rdf.1sr.gz elvi.1sr.gz @mandir@/man1/wayback.1sr.gz elvi.1sr.gz @mandir@/man1/webster.1sr.gz elvi.1sr.gz @mandir@/man1/wetandwild.1sr.gz elvi.1sr.gz @mandir@/man1/wikipedia.1sr.gz elvi.1sr.gz @mandir@/man1/woffle.1sr.gz elvi.1sr.gz @mandir@/man1/wolfram.1sr.gz elvi.1sr.gz @mandir@/man1/worldwidescience.1sr.gz elvi.1sr.gz @mandir@/man1/yacy.1sr.gz elvi.1sr.gz @mandir@/man1/yahoo.1sr.gz elvi.1sr.gz @mandir@/man1/yandex.1sr.gz elvi.1sr.gz @mandir@/man1/youtube.1sr.gz elvi.1sr.gz @mandir@/man1/yubnub.1sr.gz diff --git a/test/Makefile.am b/test/Makefile.am index 86e8c73..64009b1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,35 +1,34 @@ EXTRA_DIST = runtests elviwithouttests README COOKIES W.test S.test \ acronym.test ads.test alioth.test amazon.test archpkg.test \ archwiki.test arxiv.test ask.test aur.test austlii.test \ bbcnews.test bing.test bookfinder.test bugmenot.test \ bugzilla.test cablesearch.test cia.test cisco.test cite.test \ - cliki.test cnn.test codesearch.test comlaw.test ctan.test \ - currency.test cve.test debbugs.test debcodesearch.test \ - debcontents.test deblists.test deblogs.test debpackages.test \ - debpkghome.test debpts.test debsec.test debvcsbrowse.test \ - debwiki.test deja.test deli.test discogs.test dmoz.test \ - duckduckgo.test ebay.test etym.test excite.test f5.test \ - finkpkg.test foldoc.test freebsd.test freedb.test \ - freshmeat.test fsfdir.test gcache.test genbugs.test \ - genportage.test github.test gmane.test google.test \ - gutenberg.test imdb.test ixquick.test jamendo.test \ - javasun.test jquery.test lastfm.test leodict.test l1sp.test \ - lsm.test macports.test mathworld.test mdn.test mininova.test \ - musicbrainz.test mysqldoc.test netbsd.test ntrs.test \ - openbsd.test openports.test opensearch.test oraclesearch.test \ - pasearch.test pgdoc.test phpdoc.test pin.test piratebay.test \ - pgpkeys.test priberam.test pubmed.test rae.test rfc.test \ - rhyme.test rpmsearch.test scholar.test scicom.test \ - scitopia.test scirus.test scpan.test slashdot.test \ + cliki.test cnn.test comlaw.test ctan.test currency.test \ + cve.test debbugs.test debcodesearch.test debcontents.test \ + deblists.test deblogs.test debpackages.test debpkghome.test \ + debpts.test debsec.test debvcsbrowse.test debwiki.test \ + deja.test deli.test discogs.test dmoz.test duckduckgo.test \ + ebay.test etym.test excite.test f5.test finkpkg.test \ + foldoc.test freebsd.test freedb.test freshmeat.test \ + fsfdir.test gcache.test genbugs.test genportage.test \ + github.test gmane.test google.test gutenberg.test imdb.test \ + ixquick.test jamendo.test javasun.test jquery.test lastfm.test \ + leodict.test l1sp.test lsm.test macports.test mathworld.test \ + mdn.test mininova.test musicbrainz.test mysqldoc.test \ + netbsd.test ntrs.test openbsd.test openports.test \ + opensearch.test oraclesearch.test pasearch.test pgdoc.test \ + phpdoc.test pin.test piratebay.test pgpkeys.test priberam.test \ + pubmed.test rae.test rfc.test rhyme.test rpmsearch.test \ + scholar.test scicom.test scirus.test scpan.test slashdot.test \ slinuxdoc.test sourceforge.test springer.test stack.test \ stockquote.test thesaurus.test translate.test urban.test \ w3css.test w3html.test w3link.test w3rdf.test wayback.test \ webster.test wetandwild.test wikipedia.test wolfram.test \ woffle.test worldwidescience.test yacy.test yahoo.test \ yandex.test youtube.test yubnub.test test: ./runtests ./elviwithouttests
JNRowe/surfraw
a28f2696c3e77892fee4f592114e671efa25f156
yandex: disabled test: wants captcha
diff --git a/ChangeLog b/ChangeLog index 730fdd4..d05c214 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,516 @@ +2013-12-10 Ian Beckwith <[email protected]> + + * yandex: disabled test: redirects to captcha when used with LWP. + 2013-12-09 Ian Beckwith <[email protected]> * deja: disable tests, google groups now requires javascript. * gmane: fix test. * codesearch: removed, service shut down. * scitopia: removed, service shut down. * scicom: down, status unknown, made note in NEWS. 2013-12-08 Ian Beckwith <[email protected]> * new elvi: gmane * openbsd -mail: use gmane (directly, not via gmane elvi) * fix tests: ads, pgdoc, pin, yacy 2013-10-27 Ian Beckwith <[email protected]> * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. * pgdoc, wayback: fixed tests. 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> diff --git a/test/yandex.test b/test/yandex.test index 71975fd..933e49e 100644 --- a/test/yandex.test +++ b/test/yandex.test @@ -1,2 +1,2 @@ -yandex putin -wikipedia.org +SKIP demands captcha when used with LWP +
JNRowe/surfraw
0de246bed0fa3faf4488405ccfeb1b61de320c7a
debian: revert to actual release version in changelog
diff --git a/debian/changelog b/debian/changelog index 99060e9..0fddf8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,522 +1,522 @@ -surfraw (2.2.9~rc1-1) unstable; urgency=low +surfraw (2.2.9-1) unstable; urgency=low * New upstream version + yandex: Fix bashism (Closes: #690615). + rae: Fix URL (Closes: #680138). * Standards-Version: 3.9.4 (no changes). * update debian/copyright. * switch to source format 3.0 (quilt). - -- Ian Beckwith <[email protected]> Sun, 27 Oct 2013 15:05:40 +0000 + -- Ian Beckwith <[email protected]> Mon, 09 Dec 2013 15:09:58 +0000 surfraw (2.2.8-1) unstable; urgency=low * New upstream version + SURFRAW_graphical_remote defaults to off, as chromium doesn't support '-remote openURL()' (Closes: #628683). * Move opensearch elvi to main surfraw package. It now has an optional mode that uses a redirector if the dependencies are not installed. * debian/rules: + hardcode AWK as awk (Closes: #608967). + use dh_prep instead of dh_clean -k. + add build-arch and build-indep targets. * debian/control: + Build-Depends: bump debhelper dependency to (>= 7). + Standards-Version: 3.9.2. + surfraw-extra: convert Conflicts: to Breaks:. + surfraw: * Breaks: surfraw-extra (<= 2.2.7-1) as we have taken over /usr/lib/surfraw/opensearch. * Recommends: surfraw-extra: add version of (>> 2.2.7-1). * Tweak Description. * debian/source/format: explicitly specify 1.0 source format. -- Ian Beckwith <[email protected]> Tue, 12 Jul 2011 01:31:52 +0100 surfraw (2.2.7-1) unstable; urgency=low * New upstream version. + fixed imdb elvi (Closes: #577263). * Standards-Version: 3.8.4 (no changes). * Add ${misc:Depends} to dependencies. -- Ian Beckwith <[email protected]> Fri, 16 Apr 2010 20:43:27 +0100 surfraw (2.2.6-1) unstable; urgency=low * New upstream version. + Only use first matching bookmark (Closes: #530786). + Fix debsec (patch from Moritz Muehlenhoff) (Closes: #550741). * Remove Moritz from Uploaders (per #550741), thanks for your work!. * debian/rules: call dh_installexamples to install examples/ dir. * debian/control: + update vcs- fields to point to new git repo. + Standards-Version: 3.8.3 (No changes). + add Recommends: curl | wget | libwww-perl for -o. + Remove Conflicts/Replaces: surfaw, this transition was complete many releases ago. -- Ian Beckwith <[email protected]> Fri, 20 Nov 2009 03:34:34 +0000 surfraw (2.2.5-1) unstable; urgency=low * New upstream version. * Removed Thomas Smith from Uploaders (Closes: #519378). Thanks for your work!. * Updated my email address in Uploaders. * Fixed VCS-Browser URL (Closes: #528299). * Removed DM-Upload-Allowed header. * Standards-Version: 3.8.1 (no changes). -- Ian Beckwith <[email protected]> Wed, 13 May 2009 02:09:49 +0100 surfraw (2.2.4-1) unstable; urgency=low * New upstream version. * postrm: add 'set -e'. * debian/copyright: + Update copyright years to include 2009. + point to right GPL link (NB only the file 'missing' is GPLed, most of the package is PD). -- Ian Beckwith <[email protected]> Sun, 01 Mar 2009 02:30:59 +0000 surfraw (2.2.3-1) unstable; urgency=low * New upstream version. + Now defaults to graphical mode, see surfraw(1) for how to change it back. * Change default text browser to www-browser and default graphical browser to sensible-browser. -- Ian Beckwith <[email protected]> Tue, 26 Aug 2008 22:36:24 +0100 surfraw (2.2.2-3) unstable; urgency=low * Backport slinuxdoc fix from 2.2.3 prerelease. -- Ian Beckwith <[email protected]> Fri, 25 Jul 2008 05:14:30 +0100 surfraw (2.2.2-2) unstable; urgency=medium * google: fix bashism and quote more variable expansions (Closes: #489902). Thanks to Philip Armstrong and John Briggs. * Reformat debian/copyright to keep lintian happy. -- Ian Beckwith <[email protected]> Sat, 19 Jul 2008 00:50:33 +0100 surfraw (2.2.2-1) unstable; urgency=low * New upstream version: + fix url escaping (Closes: #487430). + surfraw-update-path: fix csh support (Closes: #484871). * Recommends: Drop w3m-ssl (folded into w3m) and lynx-cur (not in lenny) (Closes: #471359). * surfraw-extra: improve long description (Closes: #471321). * Standards-Version: 3.8.0 (no changes). * Remove linda override. * Add watch file. -- Ian Beckwith <[email protected]> Thu, 03 Jul 2008 01:22:36 +0100 surfraw (2.2.1-2) unstable; urgency=low * Remove my old email address from Uploaders. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:35 +0000 surfraw (2.2.1-1) unstable; urgency=low * New upstream release. + bashisms removed (Closes: #465361, #468139). * debian/rules: move .deb building to binary-indep: target. * debian/compat: bump to 6. * debian/control: + DM-Upload-Allowed: yes merged from Debian-only 2.1.7-1 (see below). Dropped XS- prefix, no longer needed. + Recommends: add elinks | elinks-lite to existing browser alternatives. + Uploaders: update my email address. + Standards-Version: 3.7.3 (no changes). + Build-Depends: Bump debhelper version to >= 6. + Vcs-Cvs/Vcs-Browser: remove XS- prefix and -d workaround. + Homepage: added. * debian/changelog: merged Moritz's debian-only 2.1.7 release changelog. * debian/linda.overrides: remove exec-not-elf-or-script tag now file(1) is fixed. * debian/copyright: update, use machine-interpretable format. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:08 +0000 surfraw (2.2.0-1) UNRELEASED; urgency=low * Actual first new upstream release. See changelog.gz for upstream changes, like a normal package. * debian/rules: Use $(CURDIR) instead of `pwd`. * debian/copyright: updated copyright dates. -- Ian Beckwith <[email protected]> Tue, 11 Sep 2007 03:41:09 +0100 surfraw (2.1.8-1) UNRELEASED; urgency=low * First proper upstream release of the surfraw-devel version. After this release non-debian changes will be logged in the upstream changelog.gz. * Split off opensearch into new package: surfraw-extra as it has a huge dependency tree that not everyone will want to install. * Fixed "sr -options bookmark" (excessive quoting). * New elvi: + archpkg - search Arch Linux packages. Thanks to Simon Ernst. + port - look up a TCP/UDP port on seifried.org/security/ports. * Fixed elvi + debbugs: fixed help formatting. + debcontents - new options * Fixed tests: + austlii - (since when does a legal db not contain "tort"?). + deblists - -security-announce not indexed (#440347), so we search for WNPP posts on -devel. + debpackages. + sunsolve - added cookie to accept license. + w3html - validator will not validate itself. * runtests (see test/README): + Added cookie support. + Added support for skipping tests with SKIP. + Abort if libwww-perl not installed. + Documented changes in test/README. * Makefile.am: removed debian/ files from EXTRA_DIST, they should be in the debian patch not the main tarball. * Bumped debhelper compat level to 5. * Really updated to automake-1.10. * Updated AUTHORS, NEWS, README, HACKING, ChangeLog, NEWS.Debian. -- Ian Beckwith <[email protected]> Fri, 07 Sep 2007 00:18:38 +0100 surfraw (2.1.7) unstable; urgency=low * Add "XS-DM-Upload-Allowed: yes", so that Ian can upload further updates on his own. -- Moritz Muehlenhoff <[email protected]> Sun, 13 Jan 2008 23:23:30 +0100 surfraw (2.1.6) unstable; urgency=low * New elvi: + codesearch - search google code search. + debwiki - search wiki.debian.org and women.debian.org/wiki. + lastfm - search last.fm. + musicbrainz - search musicbrainz.org. + opensearch - search sites that provide an OpenSearch description: - Install helper scripts opensearch-discover and opensearch-genquery to /usr/bin. - Add Dependencies on libwww-opensearch-perl, libwww-perl and libhtml-parser-perl. - Makefile.am: replaced explicit rule for surfraw-update-path.1 with a static pattern rule for making man pages from perl scripts. * Fixed elvi: + amazon - fixed example usage. + cia - switched to https. + cite - fixed URL and options. + debpackages - updated ubuntu distro names. + debcontents - updated ubuntu distro names. + freebsd - fixed help formatting. + netbsd - fixed mailing list searches. + openbsd - fixed PR search URL. + slinuxdoc - fixed URLs. + sundocs - fixed URLs. + woffle - updated URLs to match woffle 2.9a. * Removed elvi: jake - site shut down January 2007. * Implemented test suite - 'make test' or see test/README. * Fixed make distcheck. * Updated to automake 1.10. * debian/rules: stopped ignoring return code of 'make distclean'. * Updated Copyright dates to 2007. * Add Vcs-Cvs and Vcs-Browser fields to debian/control. -- Ian Beckwith <[email protected]> Sat, 30 Jun 2007 22:15:14 +0100 surfraw (2.1.5) unstable; urgency=low * Added myself to Uploaders. * Ack not-really-NMU (Closes: #354737). * Applied bash completion fixes, thanks to Justin B. Rye (Closes: #361668). * wikipedia: disable requoting; use Go rather than Search. * Fixes to ixquick elvi, thanks to Aparna Jaitly. * debpackages/debcontents: new options + ubuntu support with -u. * New elvi: scholar - search google scholar. * New elvi: discogs, thanks to Patroklos Argyroudis. * Thanks to James Rowe for the following patches: + Move W to /usr/lib/surfraw (see http://bugs.gentoo.org/show_bug.cgi?id=58955). + New elvi: genpkg for Gentoo package search. + Generate elvi list on demand and eliminate surfraw_elvi.list + Make elvidir configurable. + Make sysconfdir configurable. + Fix 'make dist' and 'make distcheck'. + Remove unused browser checks. + Drop AC_CANONICAL_HOST - not needed. * New global option: -p / -print: just print search url. * Remove config.guess and config.sub - not needed. * Remove config.{guess,sub} updating logic from debian/rules. * postrm: remove /etc/surfraw_elvi.list if it exists. * Convert debhelper Build-Depends-Indep: to Build-Depends:. * Standards-Version: 3.7.2 (No changes). * Updated Copyright dates to 2006. * Added linda override exec-not-elf-or-script for /usr/bin/surfraw due to erroneous file(1) output (See: #369977). * Tweak HACKING appendix 1 to remove need to build surfraw_elvi.list. -- Ian Beckwith <[email protected]> Tue, 26 Sep 2006 04:22:53 +0100 surfraw (2.1.4) unstable; urgency=low * Ian Beckwith <[email protected]>: + changed elvi: - debsec: fix tabbing (Closes: #354737). - debbugs: updated search options. + new elvi: - ixquick (Thanks to Aparna Jaitly). - ctan. - fsfdir. - gutenberg. - wayback. + Makefile.include: changed sed invocation to work with both old and new make(1). + debian/rules install: removed spurious mkdir. + removed debian/{prerm,postinst}. + Switched to debhelper compat level 4. + HACKING: corrected appendix 1. -- Ian Beckwith <[email protected]> Fri, 17 Mar 2006 22:26:37 +0000 surfraw (2.1.3) unstable; urgency=high * Urgency high, as it renders surfraw uninstallable * Really, really remove debconfage (Closes: #354263) -- Moritz Muehlenhoff <[email protected]> Fri, 24 Feb 2006 23:00:09 +0100 surfraw (2.1.2) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Fix FTBFS due to make changes (Patch by Matt Kraai) (Closes: 353314) + Fix zsh completion for yubnub (Patch by Micah Anderson) (Closes: #341872) + Remove debian/po to prevent further translations in vain. Sorry for the wasted work on the Swedish translation, Daniel Nylander! (Closes: #338149, #336687) + Changed maintainer address to "Debian surfraw maintainers", added Christian, Thomas and myself to uploaders + New elvis: debsec (for the Debian security tracker) -- Moritz Muehlenhoff <[email protected]> Thu, 23 Feb 2006 16:49:55 +0100 surfraw (2.1.1) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Removed debconf information about new elvi structure, now that Sarge has been released with it. Moved it to README.Debian. (Closes: #313852, #312979, #319841, #319842) + New elvis: yubnub (by Iain D Broadfoot) (Closes: #315188) + Removed unused SURFRAW_p0rn option (Closes: #324166) + Bumped standards version (no changes required) + Change to a native package, most of the elvis are now more or less Debian specific anyway -- Moritz Muehlenhoff <[email protected]> Fri, 29 Apr 2005 16:20:39 +0200 surfraw (2.1.0-1) unstable; urgency=medium * Ian Beckwith <[email protected]>: + New elvi: dmoz, w3html, w3link, w3css, w3rdf. + New elvi: rae (by Ruben Pollan <[email protected]>). + surfraw.IN:w3_url_escape: escaped `(' and `)'. + Fixed elvi (Thanks to Justin B. Rye): - sunsolve (Closes: #289502). - altavista (Closes: #289503). + deblists: Updated list of debian mailing lists. + currency: Now a proper elvis. + Added appendix 2 to HACKING on preparing a release. * Moritz Muehlenhoff <[email protected]>: + Switch rhymes search from Lycos to Rhymezone (by Justin B Rye) (Closes: #289498) + Fix BBC News search (by Justin B Rye) (Closes: #289499) + New elvi by by Justin B Rye (Closes: #290032) - cia Search for CIA documents - deblogs Debian changelogs - etym Search for word origins - foldoc Free online dictionary of computing + New cve elvis for CAN assignment searches + Rewrite debian/copyright properly -- Thomas Smith <[email protected]> Wed, 20 Apr 2005 17:00:59 -0500 surfraw (2.0.2-2) unstable; urgency=low * Applied Brian Mcdonald's workaround for bash bug (Closes: #269982) -- Christian Surchi <[email protected]> Mon, 13 Sep 2004 16:34:53 +0100 surfraw (2.0.2-1) unstable; urgency=low * Several patches from Justin B Rye: + Add bash completion (Closes: #240629) + Add some missing elvis in surfraw_elvi.list (Closes: #241079) + Don't set DISPLAY when in text-only mode (Closes: #235251) + Correctly test for text-mode in w3_browse_url() + Readability improvements + Use argv[0] instead of computing it through basename * Removed elvi: + sharereactor: has been closed down * Added French debconf template by Christian Perrier (Closes: #236088) * Added German debconf template by Helge Kreutzmann (Closes: #253800) * New elvi: debpts. * man page hyphenation fixes. * debian/control: + Dropped optional last part of Standards-Version. + Changed lynx to lynx-cur in Recommends to avoid confusing apt. + Added po-debconf to Build-Depends-Indep. * debian/rules clean: + enabled config.{guess,sub} update. + remove templates.merged. * HACKING: updated Appendix 1. * surfraw.conf.in: set SURFRAW_graphical_browser to x-www-browser (Closes: #256201) -- Ian Beckwith <[email protected]> Thu, 29 Jul 2004 15:31:10 +0100 surfraw (2.0.1-1) unstable; urgency=low * Moved elvi to /usr/lib/surfraw (Closes: #230276) * Updated docs for new elvi location * Changed man page section for all elvi to 1sr (Closes: #230056) * Fixed surfraw help text (Closes: #230109) * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Updated README with text from new man page. * Added "Copyright (c) 2003, 2004 The Surfraw-Devel Team <[email protected]>" to the list of copyright holders. * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again. * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them (Closes: #231939). * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * Added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * Disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * Synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf -- Ian Beckwith <[email protected]> Tue, 10 Feb 2004 03:33:14 +0000 surfraw (2.0-1) unstable; urgency=low * Ack NMUs. (Closes: #200164, #201229, #209155, #113148, #119357, #131661) * ..and.. (Closes: #149584, #156466, #141243, #154304, #164206, #141242) * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and ebay, pgpkeys and sharereactor, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Closing non-bugs: - Complaint about correct behaviour (Closes: #173714). - Adds functionality already present in debcontents (Closes: #144080). - Obsoleted by sensible-browser (imho) (Closes: #155423). -- Ian Beckwith <[email protected]> Sun, 9 Nov 2003 22:02:44 +0000 surfraw (1.0.7-3) unstable; urgency=low * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. -- Thomas Smith <[email protected]> Thu, 4 Sep 2003 18:09:29 -0500 surfraw (1.0.7-2) unstable; urgency=low * The first "collaborative" release :) * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* -- Christian Surchi <[email protected]> Sat, 16 Aug 2003 17:02:03 +0000 surfraw (1.0.7-1) unstable; urgency=low * New upstream release * New debian/rules with DH_COMPAT=3 too * Elvi: linuxdoc renamed to slinuxdoc translate renamed to stranslate * Removed unuseful scripts in debian directory * Removed emacs settings in changelog -- Christian Surchi <[email protected]> Sat, 2 Mar 2002 23:54:34 +0100 surfraw (1.0.4-1) unstable; urgency=low * New upstream release, surfraw becomes public domain * Support "--" option to end all options (Closes:#113429) * Added elvi for Debian bugs search (Closes:#70109) * Fixed typo (Closes:#100431) * Removed elvi: ircsearch, newscientist (Closes:#113004,#80099) -- Christian Surchi <[email protected]> Thu, 25 Oct 2001 06:56:17 -0400
JNRowe/surfraw
df2e907d280d62e4cd260c770412ee5322a88fd0
removed codesearch and scitopia, both services shutdown
diff --git a/ChangeLog b/ChangeLog index 10b9002..730fdd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,520 @@ +2013-12-09 Ian Beckwith <[email protected]> + + * deja: disable tests, google groups now requires javascript. + * gmane: fix test. + * codesearch: removed, service shut down. + * scitopia: removed, service shut down. + * scicom: down, status unknown, made note in NEWS. + 2013-12-08 Ian Beckwith <[email protected]> * new elvi: gmane * openbsd -mail: use gmane (directly, not via gmane elvi) * fix tests: ads, pgdoc, pin, yacy 2013-10-27 Ian Beckwith <[email protected]> * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. * pgdoc, wayback: fixed tests. 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> diff --git a/NEWS b/NEWS index 30436d8..b689c72 100644 --- a/NEWS +++ b/NEWS @@ -1,485 +1,486 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + gmane - search mailing lists + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha + yacy - search YaCy P2P search engines, including ScienceNet * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, openbsd musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or -custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Debian packaging now included in release, in debian/ dir. * Known problems at time of release + deblogs - down (hopefully) temporarily + yacy - demo portal down, ScienceNet still up + + scicom - down, status unknown Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$ diff --git a/elvi/codesearch b/elvi/codesearch deleted file mode 100755 index 3daa8c4..0000000 --- a/elvi/codesearch +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -# elvis: codesearch -- Search source code using Google Code Search (www.google.fr/codesearch) -. surfraw || exit 1 - -w3_config_hook () { -def SURFRAW_codesearch_lang any -def SURFRAW_codesearch_package "" -def SURFRAW_codesearch_files "" -def SURFRAW_codesearch_license any -def SURFRAW_codesearch_class "" -def SURFRAW_codesearch_function "" -defyn SURFRAW_codesearch_case 0 -} - -w3_usage_hook () { - cat <<EOF -Usage: $w3_argv0 [options] [search words or regular expressions]... -Description: - Surfraw search source code using Google Code Search (www.google.fr/codesearch) -Local options: - -lang=LANG Limit search to programming language LANG - Options: - any (default), actionscript, ada applescript, - asp, assembly, autoconf automake, awk, basic, - bat, c, c++, c#, caja, cobol, coldfusion, - configure, css, d, eiffel, erlang, fortran, go, - haskell, inform, java, javascript, jsp, lex, - limbo, lisp, lolcode, lua, m4, makefile, maple, - mathematica, matlab, messagecatalog, modula2, - modula3, objectivec, ocaml, pascal, perl, php, - pod, prolog, proto, python, r, rebol, ruby, - sas, scheme, scilab, shell, sgml, smalltalk, - sql, sml, svg, swig, tcl, tex, texinfo, troff, - verilog, vhdl, vim, xslt, xul, yacc - -package=REGEXP Find code in packages matching REGEXP - -files=REGEXP Find code in files matching REGEXP - -license=LICENSE Find code with the specified license - Options: - any (default),aladdin, artistic, apache, apple, - bsd, cpl, epl, agpl, gpl, lgpl, disclaimer, - ibm, lucent, mit, mozilla, nasa, python, qpl, - sleepycat, zope - -class=CLASS Find code in a class matching CLASS - -function=FUNC Find code in a function matching FUNC - -case Case Sensitive matching -EOF - w3_global_usage -} - -w3_parse_option_hook () { - opt="$1" - optarg="$2" - case "$opt" in - -pack*=*) setopt SURFRAW_codesearch_package $optarg ;; - -fi*=*) setopt SURFRAW_codesearch_files $optarg ;; - -ca*) setoptyn SURFRAW_codesearch_case 1 ;; - -lan*=*) setopt SURFRAW_codesearch_lang $optarg ;; - -li*=*) setopt SURFRAW_codesearch_license $optarg ;; - -cl*=*) setopt SURFRAW_codesearch_class $optarg ;; - -fu*=*) setopt SURFRAW_codesearch_function $optarg ;; - *) return 1 ;; - esac - return 0 -} - -add_if_set() -{ - if test -n "$1"; then - echo "+$2:$1" - fi -} - -w3_config -w3_parse_args "$@" -# w3_args now contains a list of arguments -if test -z "$w3_args"; then - w3_browse_url "http://www.google.fr/codesearch" -else - escaped_args=`w3_url_of_arg $w3_args` - case "$SURFRAW_codesearch_lang" in - any) setopt SURFRAW_codesearch_lang "" ;; - cplusplus) SURFRAW_codesearch_lang="%22c%2B%2B%22" ;; - csharp) SURFRAW_codesearch_lang="c%23" ;; - esac - - if [ "$SURFRAW_codesearch_license" = "any" ]; then - setopt SURFRAW_codesearch_license "" - else - setopt SURFRAW_codesearch_license "^${SURFRAW_codesearch_license}\$" - fi - - query="${escaped_args}" - query="${query}$(add_if_set "$SURFRAW_codesearch_package" "package")" - query="${query}$(add_if_set "$SURFRAW_codesearch_lang" "lang")" - query="${query}$(add_if_set "$SURFRAW_codesearch_file" "file")" - query="${query}$(add_if_set "$SURFRAW_codesearch_class" "class")" - query="${query}$(add_if_set "$SURFRAW_codesearch_function" "function")" - query="${query}$(add_if_set "$SURFRAW_codesearch_license" "license")" - if ifyes SURFRAW_codesearch_case; then - query="${query} case:yes" - fi - - url="http://www.google.fr/codesearch#search/&q=${query}&type=cs" - w3_browse_url "$url" -fi diff --git a/elvi/scitopia b/elvi/scitopia deleted file mode 100755 index e77c4fb..0000000 --- a/elvi/scitopia +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# elvis: scitopia -- Search for science with scitopia.org -. surfraw || exit 1 - -w3_usage_hook () { - cat <<EOF -Usage: $w3_argv0 [options] [search words]... -Description: - Surfraw search for science with scitopia.org -EOF - w3_global_usage -} - -w3_config -w3_parse_args "$@" -# w3_args now contains a list of arguments - -if test -z "$w3_args"; then - w3_browse_url "http://www.scitopia.org/scitopia/" -else - escaped_args=`w3_url_of_arg $w3_args` - w3_browse_url "http://www.scitopia.org/scitopia/result-list/fullRecord:${escaped_args}" -fi diff --git a/test/codesearch.test b/test/codesearch.test deleted file mode 100644 index 97bc447..0000000 --- a/test/codesearch.test +++ /dev/null @@ -1 +0,0 @@ -SKIP needs javascript diff --git a/test/scitopia.test b/test/scitopia.test deleted file mode 100644 index 97bc447..0000000 --- a/test/scitopia.test +++ /dev/null @@ -1 +0,0 @@ -SKIP needs javascript
JNRowe/surfraw
ea7248e619499e31ad1886d2e8eaa6083904be6d
deja: disable tests, needs javascript
diff --git a/test/deja.test b/test/deja.test index 26c9356..01b7c55 100644 --- a/test/deja.test +++ b/test/deja.test @@ -1,2 +1,2 @@ -deja kibology -alt.religion.kibology +SKIP javascript + diff --git a/test/gmane.test b/test/gmane.test index d7b468f..bf98fba 100644 --- a/test/gmane.test +++ b/test/gmane.test @@ -1,4 +1,4 @@ -gmane -l="gmane.os.openbsd.*" Raadt +gmane -li="gmane.os.openbsd.*" Raadt Theo gmane -L openbsd gmane.os.openbsd
JNRowe/surfraw
88c5f332d85d099a9d1dc9b7c2cd7329150e0b73
new elvi: gmane;fix elvi: openbsd; fix tests: ads, pgdoc, pin, yacy (but test 1 still fails, yacy down hopefully temporarily)
diff --git a/AUTHORS b/AUTHORS index e52c4c3..fa2027c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,165 +1,165 @@ AUTHORS Julian Assange <[email protected]> original author Christian Surchi <[email protected]> original debian maintainer elvi: debcontents, debbugs, debpackages Ian Beckwith <[email protected]> current debian maintainer elvi: alioth, bbcnews, bugzilla, deblists, freedb, imdb, scpan, codesearch, debwiki, lastfm, musicbrainz, opensearch, scholar, ctan, fsfdir, gutenberg, wayback, dmoz, w3html, w3link, w3css, w3rdf, debpts, rfc, lsm, finkpkg, rpmsearch, macports, debpkghome, debvcsbrowse, scroogle, scirus, scitopia, worldwidescience, debcodesearch, jquery, mdn, mysqldoc, pgdoc, - oraclesearch, S, yacy + oraclesearch, S, yacy, gmane plus various tweaks/bugfixes/features. Moritz Muehlenhoff <[email protected]> elvi: debsec, ebay, leodict, wikipedia, sharereactor, pgpkeys, happypenguin plus various patches/maintenance. Thomas Smith <[email protected]> Bugfixes, uploading. Stephen Stafford <[email protected]> Bug fixes Kevin Kreamer <[email protected]> Bug fixes Christian Weisgerber <[email protected]> elvi: fast, thesaurus, webster Jason Harris <[email protected]> elvi: freebsd, openbsd, filesearching, ftpfind Ruben Pollan <[email protected]> elvi: rae Ian Broadfoot <[email protected]> elvi: yubnub James Rowe <[email protected]> plus useful patches/maintenance. Aparna Jaitly <[email protected]> elvi: ixquick Justin B. Rye <[email protected]> elvi: cia, deblogs, etym, foldoc plus useful patches. Patroklos Argyroudis <[email protected]> elvi: discogs Simon Ernst <[email protected]> elvi: archpkg Ivy Foster <[email protected]> elvi: bookfinder, bugmenot plus various patches/maintenance Sumant Oemrawsingh <[email protected]> elvi: cliki, l1sp, mathworth, mininova, youtube plus patches, including the uzbl examples. Sadako <[email protected]> imdb fixes tczy <[email protected]> elvi: bing Simone Fittabile <[email protected]> elvi: acronym, gcache, jamendo plus patches. Micah Anderson <[email protected]> various patches René Reigel <[email protected]> elvi: aur J.R. Mauro <[email protected]> elvi: urban, piratebay, genportage Wim van Hoydonck <[email protected]> elvi: ntrs, springer, sc John Briggs <[email protected]> patch to google John Gruenenfelder <[email protected]> elvi: arxiv csh patch James TD Smith <[email protected]> elvi: javasun google country-specific options Charles Twardy <[email protected]> fixed cia Uspenskiy Andrey <[email protected]> elvi: yandex Jameson Rollins <[email protected]> elvi: ads plus tweaks. Jakob <[email protected]> elvi: pasearch Kyle Isom <[email protected]> elvi: cablesearch, duckduckgo, openports, wolfram plus various fixes/maintenance. Jason Ryan <[email protected]> elvi: archwiki, deli, github, stack, pin plus various fixes/maintenance Sara Fauzia <[email protected]> archpkg fix. Thomas Zervogiannis <[email protected]> Searchable bookmarks. Paulo Almeida <[email protected]> elvi: priberam Shain Singh <[email protected]> elvi: cisco, f5 Manolo Martínez <[email protected]> examples: elinks integration (hooks.lua) Jon Yamokoski <[email protected]> elvi: phpdoc THANKS TO Brian Nelson <[email protected]> Christian Garbs <[email protected]> Hector Blanco <[email protected]> Jeff Bailey <[email protected]> Mark W. Eichin <[email protected]> Teófilo Ruiz Suárez <[email protected]> Maru Dubshinki <[email protected]> Matt Kraai <[email protected]> Brian Mcdonald <[email protected]> Carl Fredrik Hammar <[email protected]> Andy Valencia <[email protected]> Philip Armstrong <[email protected]> Dan Jacobson <[email protected]> Sunil Nimmagadda <[email protected]> Michel <[email protected]> Nikos Apostolakis <[email protected]> Facundo Aguirre <[email protected]> Raphael Geissert <[email protected]> If we've missed anyone, let us know. diff --git a/ChangeLog b/ChangeLog index 14a0247..10b9002 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,518 @@ +2013-12-08 Ian Beckwith <[email protected]> + + * new elvi: gmane + * openbsd -mail: use gmane (directly, not via gmane elvi) + * fix tests: ads, pgdoc, pin, yacy + 2013-10-27 Ian Beckwith <[email protected]> * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. * pgdoc, wayback: fixed tests. 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC diff --git a/NEWS b/NEWS index acabe4f..f80dffb 100644 --- a/NEWS +++ b/NEWS @@ -1,484 +1,485 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + + gmane - search mailing lists + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha + yacy - search YaCy P2P search engines, including ScienceNet * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view - * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, + * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, openbsd musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or -custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Debian packaging now included in release, in debian/ dir. * Known problems + fink - down temporarily + deblogs - down (hopefully) temporarily Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$ diff --git a/README b/README index 57ec203..d311461 100644 --- a/README +++ b/README @@ -1,400 +1,401 @@ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Home Page: http://surfraw.alioth.debian.org ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web New: http://surfraw.alioth.debian.org Old: http://surfraw.sourceforge.net/ Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, babelfish, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with netscape-remote or incremental text browsers, such as links (http://artax.karlin.mff.cuni.cz/~mikulas/links/), w3m (http://www.w3m.org/), and screen(1) a Surfraw liberateur is capable of navigating speeds that leave GUI tainted idolaters agape with fear and wonder. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine. ADDING THE ELVI TO YOUR PATH If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (usually /usr/lib/surfraw or /usr/local/lib/surfraw/) to your path, either manually or using surfraw-update-path(1). CONFIG FILES Surfraw implements the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) Essentially this means global config will be in /etc/xdg/surfraw/ and local config will be in $HOME/.config/surfraw/. This can be modified by setting $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME, see the spec for more details. If your system has a different sysconfdir set during configure, that will be used instead of /etc (for instance, /usr/local/etc). In the documentation below, only the default paths will be referred to. LOCAL ELVI Surfraw can use your own private elvi, store them in $HOME/.config/surfraw/elvi/. Local elvi will be listed separately at the end of 'surfraw -elvi'. Use existing elvi (e.g. google) as a template. If you think your elvi may be useful to others, consider submitting them to [email protected]. BOOKMARKS Surfraw now supports bookmarks. To add a bookmark, add it to to the global bookmark list in /etc/xdg/surfraw/bookmarks or to your personal bookmark list in $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks CUSTOM SEARCH Several elvi use a search engine with site: and inurl: keywords. The search engine used can be customized by setting the environment variable SURFRAW_customsearch_provider or using the command-line argument -customsearch= Currently google and duckduckgo are supported Examples: SURFRAW_customsearch_provider=duckduckgo sr mysqldoc -v=5.5 select sr pgdoc -customsearch=google -v=9.1 select The default is to use duckduckgo. Currently affected elvi: mdn mysqldoc netbsd openbsd pgdoc slinuxdoc INSTALLATION Surfraw is installed with the standard ./configure; make; make install procedure. See INSTALL for more details. If you obtained surfraw direct from the git repository rather than a release tarball, run ./prebuild to generate the autotools build files *before* running ./configure. Note that the opensearch elvis depends on the perl libraries WWW::OpenSearch, HTML::Parser and LWP (libwww-perl). If you don't want to install opensearch, use ./configure --disable-opensearch. Surfraw supports the following options to ./configure: --with-text-browser=BROWSER Use BROWSER as text-mode browser --with-graphical-browser=BROWSER Use BROWSER as graphical-mode browser --with-elvidir=DIR Use DIR as location for storing elvi --disable-opensearch Disable OpenSearch support --disable-sr Disable installing sr alias By default, the text and graphical browsers are detected from a list of installed browsers at configure time. elvidir defaults to $(libdir)/surfraw (probably /usr/local/lib/surfraw). EXAMPLES $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr wikipedia surfraw $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian OPTIONS Global options are common to all Surfraw elvi (clients). You can get a list of the currently installed elvi by just typing `surfraw -elvi'. For example: $ surfraw -elvi GLOBAL ELVI: W -- Activate Surfraw defined web-browser acronym -- Look for acronyms definitions (www.acronymfinder.com) ads -- Search SAO/NASA Astrophysics Data System alioth -- Search Alioth (alioth.debian.org) amazon -- Search the amazon.com bookstore archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/) archwiki -- Search the Arch Linux Wiki arxiv -- Search arXiv E-Print Archive for articles ask -- Question the web using Ask Jeeves (www.ask.com) aur -- Search aur.archlinux.org for PKGBUILDs austlii -- Search Australian Law docs (www.austlii.edu.au) bbcnews -- Search BBC News (news.bbc.co.uk) bing -- Search the web using Microsoft's Bing (www.bing.com) bookfinder -- Search for books using www.bookfinder.com bugmenot -- Bypass compulsory web registration with bugmenot.com bugzilla -- Search for bugs on Bugzilla bugtrackers cablesearch -- search for leaked diplomatic communications cia -- Search CIA documents at www.cia.gov cisco -- Search Cisco documentation (www.cisco.com) cite -- Search computer science papers (citeseerx.ist.psu.edu) cliki -- Search the common lisp wiki cnn -- Search on CNN (cnn.com) codesearch -- Search source code using Google Code Search (www.google.fr/codesearch) comlaw -- Search Australian Law using Comlaw (www.comlaw.gov.au) ctan -- Search the Comprehensive TeX Archive Network (ctan.org) currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) cve -- Search for CAN assignments in CVE debbugs -- Search the debian BTS (bugs.debian.org) debcodesearch -- Search debian source code debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) deblists -- Search debian mailing lists (lists.debian.org/search.html) deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net) debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) debpkghome -- Visit the home page for a Debian package debpts -- Search the Debian Package Tracking System (packages.qa.debian.org) debsec -- Search the Debian Security Tracker for CVE ids or package names debvcsbrowse -- Browse the VCS repository for a Debian package debwiki -- Search the Debian Wikis (wiki.debian.org & women.debian.org/wiki) deja -- Search usenet using Google Groups (groups.google.com) deli -- Search Delicious bookmarks discogs -- Search the Discogs database of music information (www.discogs.com) dmoz -- Search the Open Directory Project web directory (dmoz.org) duckduckgo -- Securely search the web using duckduckgo (www.duckduckgo.com) ebay -- Search the Ebay auction site etym -- Look up word origins at www.etymonline.com excite -- Search on Excite (www.excite.com) f5 -- Search F5 related information (www.f5.com) finkpkg -- Search Fink packages (pdb.finkproject.org) foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org) freebsd -- Search FreeBSD related information (www.freebsd.org) freedb -- Search for cd track listings in FreeDB (www.freedb.org) freshmeat -- Search Freshmeat (www.freshmeat.net) fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org) gcache -- Search the web using Google cache (www.google.com) genbugs -- Search the Gentoo bug tracker (bugs.gentoo.org) genportage -- Search gentoo-portage.com for packages github -- Search GitHub (https://github.com) +gmane -- Search mailing list with gmane (gmane.org) google -- Search the web using Google (www.google.com) gutenberg -- Search for books on Project Gutenberg (gutenberg.org) imdb -- Search the Internet Movie Database (www.imdb.com) ixquick -- Search the web using ixquick [HTTPS] (www.ixquick.com) jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) javasun -- Search Java API docs (java.sun.com) jquery -- Search the jQuery documentation (api.jquery.com) l1sp -- Search lisp documentation lastfm -- Search last.fm leodict -- Search Leo's German <-> English dictionary (dict.leo.org) lsm -- Search the Linux Software Map macports -- Search macports packages (macports.org) mathworld -- Search Wolfram MathWorld mdn -- Search the mozilla developer network (developer.mozilla.org) mininova -- Search the mininova bittorent source. musicbrainz -- Search MusicBrainz (musicbrainz.org) mysqldoc -- Search mysql documentation (dev.mysql.com) netbsd -- Search NetBSD related information (www.netbsd.org) ntrs -- Search the NASA Technical Report Server openbsd -- Search OpenBSD related information (www.openbsd.org) openports -- search openports for OpenBSD packages opensearch -- Search an OpenSearch-enabled website oraclesearch -- Search an OpenSearch-enabled website pasearch -- Search the unofficial Penny Arcade archives (pipefour.org/pa) pgdoc -- Search postgres documentation (www.pgdoc.com) pgpkeys -- Search the PGP key database phpdoc -- Search php documentation (php.net) pin -- Search Pinboard bookmarks (http://pinboard.in) piratebay -- Search The Pirate Bay (http://thepiratebay.org) priberam -- Look up word in Priberam online dictionary (www.priberam.pt/dlpo) pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov) rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) rfc -- Search RFCs (internet standards documents) rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com) rpmsearch -- Search for RPMs in various distros scholar -- Search Google Scholar (scholar.google.com) scicom -- Search Scientific Commons scirus -- Search for science using Scirus (scirus.com) scitopia -- Search for science with scitopia.org scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org) slashdot -- Search stories on Slashdot (www.slashdot.org) slinuxdoc -- Search entries in LDP (www.linuxdoc.org) sourceforge -- Search SourceForge (www.sourceforge.net) springer -- Search Springer for Books and Articles stack -- Search Stack Overflow stockquote -- Get a single stock quote (multiple providers) thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com) translate -- Translate human languages urban -- Search urbandictionary.com for a definition w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) w3html -- Validate a web page URL with the w3c validator (validator.w3.org) w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org) webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com) wetandwild -- Real time weather information (many sources) wikipedia -- Search the free encyclopedia wikipedia woffle -- Search the web using Woffle (localhost:8080) wolfram -- Ask questions of the computational knowledge engine worldwidescience -- Search for science with www.worldwidescience.org yacy -- Search YaCy P2P search, including ScienceNet yahoo -- Search Yahoo categories (www.yahoo.com) yandex -- Search the web using Yandex (yandex.ru) youtube -- Search YouTube (www.youtube.com) yubnub -- Use the social command-line for the web (yubnub.org) All elvi have useful low calorie help, for example: Usage: rhyme [options] [search words]... Description: Surfraw search for rhymes and other word correlations using Lycos Rhyme (rhyme.lycos.com) Example: $ rhyme Julian $ rhyme -method=rel surfer Results: Hurclean St. Julien. surfboarder, bather, natator, swimmer Local options: -method= Type of word correlation to search for prefect | Perfect rhyme syn | Synonyms hom | Homophones cons | Consonsant rhymes only rel | Semantically related words sub | Phrases spell | Similar spellings pic | Pictures shake | Match with Shakespeare archives def Find wordnet definition Default: perfect Environment: SURFRAW_rhyme_method Global options: -browser=EXECUTABLE Set browser Default: sensible-browser -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: yes Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: yes Environment: SURFRAW_graphical -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: no Environment: SURFRAW_new_window -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: no Environment: SURFRAW_quote_args -version Display Surfraw version (2.2.7) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study If you just want to see the elvi-specific help, use elvi -lh or -local-help. The system wide configuration file can usually be found in /etc/xdg/surfraw/conf (but see 'Config files' above). This can be overridden by setting the environment variable SURFRAW_global_conf. Each user can also specify their own overrides, usually in $HOME/.config/surfraw/conf (again, see 'Config files' above). This can be overridden by setting SURFRAW_conf, either in the environment or the global config file. e.g SURFRAW_graphical_remote=yes SURFRAW_graphical_browser=mozilla SURFRAW_text_browser=w3m SURFRAW_pgpkeys_sigs=on INTEGRATION There is a browser plugin for Pentadactyl (a vimperator fork) at http://code.google.com/p/dactyl/issues/detail?id=320 For details, see: http://lists.alioth.debian.org/pipermail/surfraw-devel/2011-April/000916.html Code to integrate with uzbl is in examples/uzbl_load_url_from_surfraw RADICALIZATION Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on [email protected] _________________________________________________________________ README originally by Julian Assange Updated by Ian Beckwith _________________________________________________________________ See NEWS, and ChangeLog for a summary of changes. _________________________________________________________________ diff --git a/elvi/Makefile.am b/elvi/Makefile.am index e6d2a27..0bb99bb 100644 --- a/elvi/Makefile.am +++ b/elvi/Makefile.am @@ -1,130 +1,131 @@ # $Id$ elvidir=$(ELVIDIR) dist_elvi_SCRIPTS = \ S \ W \ acronym \ ads \ alioth \ amazon \ archpkg \ archwiki \ arxiv \ ask \ aur \ austlii \ bing \ bbcnews \ bookfinder \ bugmenot \ bugzilla \ cablesearch \ cia \ cisco \ cite \ cliki \ cnn \ codesearch \ comlaw \ ctan \ currency \ cve \ debbugs \ debcodesearch \ debcontents \ deblists \ deblogs \ debpackages \ debpkghome \ debpts \ debsec \ debvcsbrowse \ debwiki \ deja \ deli \ discogs \ dmoz \ duckduckgo \ ebay \ etym \ excite \ f5 \ foldoc \ finkpkg \ freebsd \ freedb \ freshmeat \ fsfdir \ gcache \ genbugs \ genportage \ github \ - gutenberg \ + gmane \ google \ + gutenberg \ imdb \ ixquick \ jamendo \ javasun \ jquery \ l1sp \ lastfm \ leodict \ lsm \ macports \ mathworld \ mdn \ mininova \ musicbrainz \ mysqldoc \ netbsd \ ntrs \ openbsd \ openports \ opensearch \ oraclesearch \ pasearch \ pgdoc \ pgpkeys \ phpdoc \ pin \ piratebay \ priberam \ pubmed \ rae \ rfc \ rhyme \ rpmsearch \ scholar \ scicom \ scitopia \ scirus \ scpan \ slashdot \ slinuxdoc \ sourceforge \ springer \ stack \ stockquote \ thesaurus \ translate \ urban \ w3css \ w3html \ w3link \ w3rdf \ wayback \ webster \ wetandwild \ wikipedia \ woffle \ wolfram \ worldwidescience \ yacy \ yahoo \ yandex \ youtube \ yubnub uninstall-local: -rmdir $(DESTDIR)$(PREFIX)/$(ELVIDIR) diff --git a/elvi/gmane b/elvi/gmane new file mode 100755 index 0000000..23dc35e --- /dev/null +++ b/elvi/gmane @@ -0,0 +1,85 @@ +#!/bin/sh +# elvis: gmane -- Search mailing list with gmane (gmane.org) +. surfraw || exit 1 + +w3_config_hook () { + defyn SURFRAW_gmane_or 0 + defyn SURFRAW_gmane_listsearch 0 + def SURFRAW_gmane_list "" + def SURFRAW_gmane_author "" + def SURFRAW_gmane_sort "relevance" +} + +w3_usage_hook () { + cat <<EOF +Usage: $w3_argv0 [options] [search words]... +Description: + Surfraw search mailing lists with gmane (gmane.org) +Local options: + -list=LIST Search list(s) + eg -l=gmane.os.openbsd.vax or -l="gmane.os.openbsd.*" + -L Search by list name instead of contents + -author=NAME Limit search to posts by NAME + Default: $SURFRAW_gmane_results + Environment: SURFRAW_gmane_results + -sort= Sort by: + relevance Relevance + date Newest first + revdate Oldest first + -or OR search results instead of ANDing. +EOF + w3_global_usage +} + +w3_parse_option_hook () { + opt="$1" + optarg="$2" + case "$opt" in + -li*=*) setopt SURFRAW_gmane_group "$optarg" ;; + -au*=*) setopt SURFRAW_gmane_author "$optarg" ;; + -so*=*) setopt SURFRAW_gmane_sort "$optarg" ;; + -L) setoptyn SURFRAW_gmane_listsearch 1 ;; + -or) setoptyn SURFRAW_gmane_or 1 ;; + *) return 1 ;; + esac + return 0 +} + +w3_config +w3_parse_args "$@" + +if test -z "$w3_args" +then + if ifyes SURFRAW_gmane_listsearch + then + url=http://gmane.org/find.php + else + url=http://search.gmane.org/ + fi +else + escaped_args=`w3_url_of_arg $w3_args` + if ifyes SURFRAW_gmane_listsearch + then + url="http://dir.gmane.org/search.php?match=${escaped_args}" + else + url="http://search.gmane.org/?query=${escaped_args}&sort=${SURFRAW_gmane_sort}" + if [ "$SURFRAW_gmane_author" != "" ] + then + url="${url}&author=${SURFRAW_gmane_author}" + fi + if ifyes SURFRAW_gmane_or + then + url="${url}&DEFAULTOP=or" + else + url="${url}&DEFAULTOP=and" + fi + if [ "${SURFRAW_gmane_group}" != "" ] + then + url="${url}&group=${SURFRAW_gmane_group}" + fi + fi +fi + +w3_browse_url "$url" + + diff --git a/elvi/openbsd b/elvi/openbsd index e2ac3dc..53ef839 100755 --- a/elvi/openbsd +++ b/elvi/openbsd @@ -1,102 +1,102 @@ #!/bin/sh # $Id$ # elvis: openbsd -- Search OpenBSD related information (www.openbsd.org) . surfraw || exit 1 w3_config_hook () { defyn SURFRAW_openbsd_mail no defyn SURFRAW_openbsd_pr no defyn SURFRAW_openbsd_ports no defyn SURFRAW_openbsd_mail_misc no defyn SURFRAW_openbsd_mail_tech no } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search-string | PR-number] Description: Surfraw search OpenBSD related information Local options: -mail[=(yes|no)] Search OpenBSD mailinglists Default: $SURFRAW_openbsd_mail Environment: SURFRAW_openbsd_mail -ps[=(yes|no)] Search ports. Default: $SURFRAW_openbsd_ports Environment: SURFRAW_openbsd_ports -misc[=(yes|no)] Search misc mailing list. Default: $SURFRAW_openbsd_mail_misc -tech[=(yes|no)] Search tech mailing list. Default: $SURFRAW_openbsd_mail_tech Examples: $w3_argv0 Teleport to the OpenBSD website $w3_argv0 mycroft Search OpenBSD website for odeur de mycroft $w3_argv0 -mail Teleport to the mail-index Query form $w3_argv0 -mail proff Search mailing-list archives for odeur de proff $w3_argv0 -ps surfraw Search ports for surfraw $w3_argv0 -misc supermicro Search misc mailing list for supermico $w3_argv0 -tech SMP Search tech mailing list for SMP EOF w3_custom_search_usage w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -mail) setoptyn SURFRAW_openbsd_mail yes ;; -mail=*) setoptyn SURFRAW_openbsd_mail $optarg ;; -ps) setoptyn SURFRAW_openbsd_ports yes ;; -ps=*) setoptyn SURFRAW_openbsd_ports $optarg ;; -misc) setoptyn SURFRAW_openbsd_mail_misc yes ;; -misc=*) setoptyn SURFRAW_openbsd_mail_misc $optarg ;; -tech) setoptyn SURFRAW_openbsd_mail_tech yes ;; -tech=*) setoptyn SURFRAW_openbsd_mail_tech $optarg ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments test -z "$w3_args" || escaped_args=`w3_url_of_arg $w3_args` if ok SURFRAW_openbsd_ports; then if test -z "$escaped_args"; then w3_browse_url "http://openports.se/" else w3_browse_url "http://openports.se/search.php?so=${escaped_args}" fi exit $? fi if ok SURFRAW_openbsd_mail; then if test -z "$escaped_args"; then w3_browse_url "http://www.openbsd.org/mail.html" else - w3_browse_url "http://groups.google.com/groups?q=group%3Amailing.openbsd.*+${escaped_args}&hl=en" + w3_browse_url "http://search.gmane.org/?query=${escaped_args}&sort=relevance&DEFAULTOP=and&group=gmane.os.openbsd.*" fi exit $? fi if ok SURFRAW_openbsd_mail_misc; then if test -z "$escaped_args"; then w3_browse_url "http://marc.info/?l=openbsd-misc&r=1&w=2" else w3_browse_url "http://marc.info/?l=openbsd-misc&w=2&r=1&s=${escaped_args}&q=b" fi exit $? fi if ok SURFRAW_openbsd_mail_tech; then if test -z "$escaped_args"; then w3_browse_url "http://marc.info/?l=openbsd-tech&r=1&w=2" else w3_browse_url "http://marc.info/?l=openbsd-tech&w=2&r=1&s=${escaped_args}&q=b" fi exit $? fi if test -z "$escaped_args"; then w3_browse_url "http://www.openbsd.org/" else w3_custom_search -s=openbsd.org "$w3_shquoted_args" fi exit $? diff --git a/test/Makefile.am b/test/Makefile.am index 8cb74a9..86e8c73 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,35 +1,35 @@ EXTRA_DIST = runtests elviwithouttests README COOKIES W.test S.test \ acronym.test ads.test alioth.test amazon.test archpkg.test \ archwiki.test arxiv.test ask.test aur.test austlii.test \ bbcnews.test bing.test bookfinder.test bugmenot.test \ bugzilla.test cablesearch.test cia.test cisco.test cite.test \ cliki.test cnn.test codesearch.test comlaw.test ctan.test \ currency.test cve.test debbugs.test debcodesearch.test \ debcontents.test deblists.test deblogs.test debpackages.test \ debpkghome.test debpts.test debsec.test debvcsbrowse.test \ debwiki.test deja.test deli.test discogs.test dmoz.test \ duckduckgo.test ebay.test etym.test excite.test f5.test \ finkpkg.test foldoc.test freebsd.test freedb.test \ freshmeat.test fsfdir.test gcache.test genbugs.test \ - genportage.test github.test google.test gutenberg.test \ - imdb.test ixquick.test jamendo.test javasun.test jquery.test \ - lastfm.test leodict.test l1sp.test lsm.test macports.test \ - mathworld.test mdn.test mininova.test musicbrainz.test \ - mysqldoc.test netbsd.test ntrs.test openbsd.test \ - openports.test opensearch.test oraclesearch.test pasearch.test \ - pgdoc.test phpdoc.test pin.test piratebay.test pgpkeys.test \ - priberam.test pubmed.test rae.test rfc.test rhyme.test \ - rpmsearch.test scholar.test scicom.test scitopia.test \ - scirus.test scpan.test slashdot.test slinuxdoc.test \ - sourceforge.test springer.test stack.test stockquote.test \ - thesaurus.test translate.test urban.test w3css.test \ - w3html.test w3link.test w3rdf.test wayback.test webster.test \ - wetandwild.test wikipedia.test wolfram.test woffle.test \ - worldwidescience.test yacy.test yahoo.test yandex.test \ - youtube.test yubnub.test + genportage.test github.test gmane.test google.test \ + gutenberg.test imdb.test ixquick.test jamendo.test \ + javasun.test jquery.test lastfm.test leodict.test l1sp.test \ + lsm.test macports.test mathworld.test mdn.test mininova.test \ + musicbrainz.test mysqldoc.test netbsd.test ntrs.test \ + openbsd.test openports.test opensearch.test oraclesearch.test \ + pasearch.test pgdoc.test phpdoc.test pin.test piratebay.test \ + pgpkeys.test priberam.test pubmed.test rae.test rfc.test \ + rhyme.test rpmsearch.test scholar.test scicom.test \ + scitopia.test scirus.test scpan.test slashdot.test \ + slinuxdoc.test sourceforge.test springer.test stack.test \ + stockquote.test thesaurus.test translate.test urban.test \ + w3css.test w3html.test w3link.test w3rdf.test wayback.test \ + webster.test wetandwild.test wikipedia.test wolfram.test \ + woffle.test worldwidescience.test yacy.test yahoo.test \ + yandex.test youtube.test yubnub.test test: ./runtests ./elviwithouttests diff --git a/test/ads.test b/test/ads.test index 36c3291..109c045 100644 --- a/test/ads.test +++ b/test/ads.test @@ -1,4 +1,2 @@ -ads lightcurve -The asteroid lightcurve database -ads keplerian elements -Equations for the Keplerian Elements: Hidden Symmetry +ads rawlings adamson whittet +extinction properties diff --git a/test/gmane.test b/test/gmane.test new file mode 100644 index 0000000..d7b468f --- /dev/null +++ b/test/gmane.test @@ -0,0 +1,4 @@ +gmane -l="gmane.os.openbsd.*" Raadt +Theo +gmane -L openbsd +gmane.os.openbsd diff --git a/test/pgdoc.test b/test/pgdoc.test index d0f0bbd..02e121a 100644 --- a/test/pgdoc.test +++ b/test/pgdoc.test @@ -1,4 +1,4 @@ SURFRAW_customsearch_provider=duckduckgo pgdoc select SELECT.*DISTINCT SURFRAW_customsearch_provider=duckduckgo pgdoc -v=9.1 select -Documentation: 9.1 +Documentation:.*9.1 diff --git a/test/pin.test b/test/pin.test index fd72006..bbdc0b1 100644 --- a/test/pin.test +++ b/test/pin.test @@ -1,2 +1,2 @@ pin surfraw -fast unix command line interface +Shell Users diff --git a/test/runtests b/test/runtests index e5e40ee..15a4568 100755 --- a/test/runtests +++ b/test/runtests @@ -1,193 +1,194 @@ #!/usr/bin/perl -w # $Id$ # Ian Beckwith <[email protected]> # eval "require LWP::UserAgent" or die("runtests: libwww-perl not found, aborting tests.\n"); use Cwd; use strict; use vars qw($me); $me=($0=~/(?:.*\/)?(.*)/)[0]; our($OK,$FAIL,$SKIP)=(0,1,2); our $ua; my $scriptpath=Cwd::abs_path($0); # drop scriptname and last path component to get srcdir my $srcdir= ($scriptpath=~/(.*)\/.*\/.*/)[0]; my @testfiles; if(@ARGV) { @testfiles=@ARGV; } else { @testfiles=<$srcdir/test/*.test>; } die("No tests found\n") unless(@testfiles); $ua=LWP::UserAgent->new; #$ua->env_proxy; $ua->cookie_jar({file => "COOKIES", autosave => 0}); # Google & CNN dont like LWP::UserAgent's UserAgent string, nicking iceweasel's $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070508 Iceweasel/2.0.0.4 (Debian-2.0.0.4-1)"); my %results; my @testnamelengths= map { my $base=(/(?:.*\/)?(.*)/)[0]; length($base); } @testfiles; my $longestname=(sort { $a <=> $b } @testnamelengths)[$#testnamelengths]; $longestname -= length ".test"; for my $testfile (@testfiles) { my ($elvi)=($testfile=~/(?:.*\/)?(.*)\.test/); unless(defined($elvi)) { $elvi=$testfile; } print $elvi; my $space=($longestname+1)-(length $elvi); if($space<1) { $space=1; } print " " x $space; $results{$elvi}=[ runtests($testfile) ]; } my @failedelvi=grep { grep { $_ == $FAIL; } @{$results{$_}}; } sort keys %results; if(@failedelvi) { my $total=keys %results; my $failed=@failedelvi; printf "Failed $failed/$total (%d%%) elvi: ", ($failed/$total) * 100; for my $badelvis (@failedelvi) { my @thisresults=@{$results{$badelvis}}; if($#thisresults) { my $first=1; print "${badelvis}["; for(my $i=0;$i<=$#thisresults;$i++) { if($thisresults[$i] == $FAIL) { if(!$first) { print ","; } $first=0; print $i+1; } } print "] "; } else { print "$badelvis "; } } print "\n"; } else { print "All tests passed.\n"; } sub runtests { my $testfile=shift; my $testnum=0; my @results=(); unless(open(TEST,$testfile)) { print "FAIL: cannot open $testfile: $!\n"; return $FAIL; } my($cmd,$match); my @tests; my $count=0; while($cmd=<TEST>) { $testnum++; chomp($cmd); next if($cmd=~/^\s*$/); # ignore blank lines if($cmd=~/^SKIP\s*(.*)/) { print "Test manually (see test/README)"; if(defined($1) && $1 ne "") { print ": $1"; } print "\n"; return $SKIP; } $count++; $match=<TEST>; unless(defined($match)) { print "FAIL: no match string defined for test $count\n"; close TEST; return $FAIL; } chomp($match); push(@tests, { $cmd => $match }); } close(TEST); my @ret=testelvis(@tests); print "\n"; return @ret; } sub testelvis { my(@tests)=@_; my @results=(); for(my $count=0; $count <= $#tests; $count++) { if($count) { print " "; } if($#tests) { print($count+1,": "); } my $hash=$tests[$count]; my $cmd =(keys (%$hash))[0]; my $match=(values(%$hash))[0]; unless(open(ELVI,"SURFRAW_lang= SURFRAW_browser=echo SURFRAW_global_conf=\"$srcdir/surfraw.conf\" PATH=\"$srcdir/elvi:$srcdir:\$PATH\" $cmd|")) { print "FAIL: cannot execute \"$cmd\": $!"; push(@results,$FAIL); next; } my $url=<ELVI>; unless(defined($url)) { print "FAIL: elvi \"$cmd\" did not produce a URL"; push(@results,$FAIL); close ELVI; next; } close ELVI; chomp $url; my $response=$ua->get($url); unless($response->is_success) { print "FAIL: Get failed: ",$response->status_line; if($response->code =~/^[45]/) { push(@results,$FAIL); } else { print "Internal Error: Code ",$response->code," not handled"; push(@results,$FAIL); } next; } my $content=$response->decoded_content || $response->content; if(!defined($content)) { print "FAIL: Result Page Empty\n"; push(@results,$FAIL); } elsif($content =~ /$match/) { print "OK"; push(@results,$OK); } else { print "FAIL: No Match"; +# print $content; push(@results,$FAIL); } } return @results; } diff --git a/test/yacy.test b/test/yacy.test index 08d6451..234af52 100644 --- a/test/yacy.test +++ b/test/yacy.test @@ -1,4 +1,4 @@ yacy yacy -by the people, for the people -yacy -S CERN -European Organization for Nuclear Research +yacy +yacy -S cern +CERN
JNRowe/surfraw
514fbc0ca8a0a3afa86a3e3096c3f50cccb66f87
debian: source format 3.0 (quilt); move ~rc1 to upstream part of version number
diff --git a/debian/changelog b/debian/changelog index f0938ca..99060e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,521 +1,522 @@ -surfraw (2.2.9-1~rc1) unstable; urgency=low +surfraw (2.2.9~rc1-1) unstable; urgency=low * New upstream version + yandex: Fix bashism (Closes: #690615). + rae: Fix URL (Closes: #680138). * Standards-Version: 3.9.4 (no changes). * update debian/copyright. + * switch to source format 3.0 (quilt). - -- Ian Beckwith <[email protected]> Sun, 27 Oct 2013 14:44:46 +0000 + -- Ian Beckwith <[email protected]> Sun, 27 Oct 2013 15:05:40 +0000 surfraw (2.2.8-1) unstable; urgency=low * New upstream version + SURFRAW_graphical_remote defaults to off, as chromium doesn't support '-remote openURL()' (Closes: #628683). * Move opensearch elvi to main surfraw package. It now has an optional mode that uses a redirector if the dependencies are not installed. * debian/rules: + hardcode AWK as awk (Closes: #608967). + use dh_prep instead of dh_clean -k. + add build-arch and build-indep targets. * debian/control: + Build-Depends: bump debhelper dependency to (>= 7). + Standards-Version: 3.9.2. + surfraw-extra: convert Conflicts: to Breaks:. + surfraw: * Breaks: surfraw-extra (<= 2.2.7-1) as we have taken over /usr/lib/surfraw/opensearch. * Recommends: surfraw-extra: add version of (>> 2.2.7-1). * Tweak Description. * debian/source/format: explicitly specify 1.0 source format. -- Ian Beckwith <[email protected]> Tue, 12 Jul 2011 01:31:52 +0100 surfraw (2.2.7-1) unstable; urgency=low * New upstream version. + fixed imdb elvi (Closes: #577263). * Standards-Version: 3.8.4 (no changes). * Add ${misc:Depends} to dependencies. -- Ian Beckwith <[email protected]> Fri, 16 Apr 2010 20:43:27 +0100 surfraw (2.2.6-1) unstable; urgency=low * New upstream version. + Only use first matching bookmark (Closes: #530786). + Fix debsec (patch from Moritz Muehlenhoff) (Closes: #550741). * Remove Moritz from Uploaders (per #550741), thanks for your work!. * debian/rules: call dh_installexamples to install examples/ dir. * debian/control: + update vcs- fields to point to new git repo. + Standards-Version: 3.8.3 (No changes). + add Recommends: curl | wget | libwww-perl for -o. + Remove Conflicts/Replaces: surfaw, this transition was complete many releases ago. -- Ian Beckwith <[email protected]> Fri, 20 Nov 2009 03:34:34 +0000 surfraw (2.2.5-1) unstable; urgency=low * New upstream version. * Removed Thomas Smith from Uploaders (Closes: #519378). Thanks for your work!. * Updated my email address in Uploaders. * Fixed VCS-Browser URL (Closes: #528299). * Removed DM-Upload-Allowed header. * Standards-Version: 3.8.1 (no changes). -- Ian Beckwith <[email protected]> Wed, 13 May 2009 02:09:49 +0100 surfraw (2.2.4-1) unstable; urgency=low * New upstream version. * postrm: add 'set -e'. * debian/copyright: + Update copyright years to include 2009. + point to right GPL link (NB only the file 'missing' is GPLed, most of the package is PD). -- Ian Beckwith <[email protected]> Sun, 01 Mar 2009 02:30:59 +0000 surfraw (2.2.3-1) unstable; urgency=low * New upstream version. + Now defaults to graphical mode, see surfraw(1) for how to change it back. * Change default text browser to www-browser and default graphical browser to sensible-browser. -- Ian Beckwith <[email protected]> Tue, 26 Aug 2008 22:36:24 +0100 surfraw (2.2.2-3) unstable; urgency=low * Backport slinuxdoc fix from 2.2.3 prerelease. -- Ian Beckwith <[email protected]> Fri, 25 Jul 2008 05:14:30 +0100 surfraw (2.2.2-2) unstable; urgency=medium * google: fix bashism and quote more variable expansions (Closes: #489902). Thanks to Philip Armstrong and John Briggs. * Reformat debian/copyright to keep lintian happy. -- Ian Beckwith <[email protected]> Sat, 19 Jul 2008 00:50:33 +0100 surfraw (2.2.2-1) unstable; urgency=low * New upstream version: + fix url escaping (Closes: #487430). + surfraw-update-path: fix csh support (Closes: #484871). * Recommends: Drop w3m-ssl (folded into w3m) and lynx-cur (not in lenny) (Closes: #471359). * surfraw-extra: improve long description (Closes: #471321). * Standards-Version: 3.8.0 (no changes). * Remove linda override. * Add watch file. -- Ian Beckwith <[email protected]> Thu, 03 Jul 2008 01:22:36 +0100 surfraw (2.2.1-2) unstable; urgency=low * Remove my old email address from Uploaders. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:35 +0000 surfraw (2.2.1-1) unstable; urgency=low * New upstream release. + bashisms removed (Closes: #465361, #468139). * debian/rules: move .deb building to binary-indep: target. * debian/compat: bump to 6. * debian/control: + DM-Upload-Allowed: yes merged from Debian-only 2.1.7-1 (see below). Dropped XS- prefix, no longer needed. + Recommends: add elinks | elinks-lite to existing browser alternatives. + Uploaders: update my email address. + Standards-Version: 3.7.3 (no changes). + Build-Depends: Bump debhelper version to >= 6. + Vcs-Cvs/Vcs-Browser: remove XS- prefix and -d workaround. + Homepage: added. * debian/changelog: merged Moritz's debian-only 2.1.7 release changelog. * debian/linda.overrides: remove exec-not-elf-or-script tag now file(1) is fixed. * debian/copyright: update, use machine-interpretable format. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:08 +0000 surfraw (2.2.0-1) UNRELEASED; urgency=low * Actual first new upstream release. See changelog.gz for upstream changes, like a normal package. * debian/rules: Use $(CURDIR) instead of `pwd`. * debian/copyright: updated copyright dates. -- Ian Beckwith <[email protected]> Tue, 11 Sep 2007 03:41:09 +0100 surfraw (2.1.8-1) UNRELEASED; urgency=low * First proper upstream release of the surfraw-devel version. After this release non-debian changes will be logged in the upstream changelog.gz. * Split off opensearch into new package: surfraw-extra as it has a huge dependency tree that not everyone will want to install. * Fixed "sr -options bookmark" (excessive quoting). * New elvi: + archpkg - search Arch Linux packages. Thanks to Simon Ernst. + port - look up a TCP/UDP port on seifried.org/security/ports. * Fixed elvi + debbugs: fixed help formatting. + debcontents - new options * Fixed tests: + austlii - (since when does a legal db not contain "tort"?). + deblists - -security-announce not indexed (#440347), so we search for WNPP posts on -devel. + debpackages. + sunsolve - added cookie to accept license. + w3html - validator will not validate itself. * runtests (see test/README): + Added cookie support. + Added support for skipping tests with SKIP. + Abort if libwww-perl not installed. + Documented changes in test/README. * Makefile.am: removed debian/ files from EXTRA_DIST, they should be in the debian patch not the main tarball. * Bumped debhelper compat level to 5. * Really updated to automake-1.10. * Updated AUTHORS, NEWS, README, HACKING, ChangeLog, NEWS.Debian. -- Ian Beckwith <[email protected]> Fri, 07 Sep 2007 00:18:38 +0100 surfraw (2.1.7) unstable; urgency=low * Add "XS-DM-Upload-Allowed: yes", so that Ian can upload further updates on his own. -- Moritz Muehlenhoff <[email protected]> Sun, 13 Jan 2008 23:23:30 +0100 surfraw (2.1.6) unstable; urgency=low * New elvi: + codesearch - search google code search. + debwiki - search wiki.debian.org and women.debian.org/wiki. + lastfm - search last.fm. + musicbrainz - search musicbrainz.org. + opensearch - search sites that provide an OpenSearch description: - Install helper scripts opensearch-discover and opensearch-genquery to /usr/bin. - Add Dependencies on libwww-opensearch-perl, libwww-perl and libhtml-parser-perl. - Makefile.am: replaced explicit rule for surfraw-update-path.1 with a static pattern rule for making man pages from perl scripts. * Fixed elvi: + amazon - fixed example usage. + cia - switched to https. + cite - fixed URL and options. + debpackages - updated ubuntu distro names. + debcontents - updated ubuntu distro names. + freebsd - fixed help formatting. + netbsd - fixed mailing list searches. + openbsd - fixed PR search URL. + slinuxdoc - fixed URLs. + sundocs - fixed URLs. + woffle - updated URLs to match woffle 2.9a. * Removed elvi: jake - site shut down January 2007. * Implemented test suite - 'make test' or see test/README. * Fixed make distcheck. * Updated to automake 1.10. * debian/rules: stopped ignoring return code of 'make distclean'. * Updated Copyright dates to 2007. * Add Vcs-Cvs and Vcs-Browser fields to debian/control. -- Ian Beckwith <[email protected]> Sat, 30 Jun 2007 22:15:14 +0100 surfraw (2.1.5) unstable; urgency=low * Added myself to Uploaders. * Ack not-really-NMU (Closes: #354737). * Applied bash completion fixes, thanks to Justin B. Rye (Closes: #361668). * wikipedia: disable requoting; use Go rather than Search. * Fixes to ixquick elvi, thanks to Aparna Jaitly. * debpackages/debcontents: new options + ubuntu support with -u. * New elvi: scholar - search google scholar. * New elvi: discogs, thanks to Patroklos Argyroudis. * Thanks to James Rowe for the following patches: + Move W to /usr/lib/surfraw (see http://bugs.gentoo.org/show_bug.cgi?id=58955). + New elvi: genpkg for Gentoo package search. + Generate elvi list on demand and eliminate surfraw_elvi.list + Make elvidir configurable. + Make sysconfdir configurable. + Fix 'make dist' and 'make distcheck'. + Remove unused browser checks. + Drop AC_CANONICAL_HOST - not needed. * New global option: -p / -print: just print search url. * Remove config.guess and config.sub - not needed. * Remove config.{guess,sub} updating logic from debian/rules. * postrm: remove /etc/surfraw_elvi.list if it exists. * Convert debhelper Build-Depends-Indep: to Build-Depends:. * Standards-Version: 3.7.2 (No changes). * Updated Copyright dates to 2006. * Added linda override exec-not-elf-or-script for /usr/bin/surfraw due to erroneous file(1) output (See: #369977). * Tweak HACKING appendix 1 to remove need to build surfraw_elvi.list. -- Ian Beckwith <[email protected]> Tue, 26 Sep 2006 04:22:53 +0100 surfraw (2.1.4) unstable; urgency=low * Ian Beckwith <[email protected]>: + changed elvi: - debsec: fix tabbing (Closes: #354737). - debbugs: updated search options. + new elvi: - ixquick (Thanks to Aparna Jaitly). - ctan. - fsfdir. - gutenberg. - wayback. + Makefile.include: changed sed invocation to work with both old and new make(1). + debian/rules install: removed spurious mkdir. + removed debian/{prerm,postinst}. + Switched to debhelper compat level 4. + HACKING: corrected appendix 1. -- Ian Beckwith <[email protected]> Fri, 17 Mar 2006 22:26:37 +0000 surfraw (2.1.3) unstable; urgency=high * Urgency high, as it renders surfraw uninstallable * Really, really remove debconfage (Closes: #354263) -- Moritz Muehlenhoff <[email protected]> Fri, 24 Feb 2006 23:00:09 +0100 surfraw (2.1.2) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Fix FTBFS due to make changes (Patch by Matt Kraai) (Closes: 353314) + Fix zsh completion for yubnub (Patch by Micah Anderson) (Closes: #341872) + Remove debian/po to prevent further translations in vain. Sorry for the wasted work on the Swedish translation, Daniel Nylander! (Closes: #338149, #336687) + Changed maintainer address to "Debian surfraw maintainers", added Christian, Thomas and myself to uploaders + New elvis: debsec (for the Debian security tracker) -- Moritz Muehlenhoff <[email protected]> Thu, 23 Feb 2006 16:49:55 +0100 surfraw (2.1.1) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Removed debconf information about new elvi structure, now that Sarge has been released with it. Moved it to README.Debian. (Closes: #313852, #312979, #319841, #319842) + New elvis: yubnub (by Iain D Broadfoot) (Closes: #315188) + Removed unused SURFRAW_p0rn option (Closes: #324166) + Bumped standards version (no changes required) + Change to a native package, most of the elvis are now more or less Debian specific anyway -- Moritz Muehlenhoff <[email protected]> Fri, 29 Apr 2005 16:20:39 +0200 surfraw (2.1.0-1) unstable; urgency=medium * Ian Beckwith <[email protected]>: + New elvi: dmoz, w3html, w3link, w3css, w3rdf. + New elvi: rae (by Ruben Pollan <[email protected]>). + surfraw.IN:w3_url_escape: escaped `(' and `)'. + Fixed elvi (Thanks to Justin B. Rye): - sunsolve (Closes: #289502). - altavista (Closes: #289503). + deblists: Updated list of debian mailing lists. + currency: Now a proper elvis. + Added appendix 2 to HACKING on preparing a release. * Moritz Muehlenhoff <[email protected]>: + Switch rhymes search from Lycos to Rhymezone (by Justin B Rye) (Closes: #289498) + Fix BBC News search (by Justin B Rye) (Closes: #289499) + New elvi by by Justin B Rye (Closes: #290032) - cia Search for CIA documents - deblogs Debian changelogs - etym Search for word origins - foldoc Free online dictionary of computing + New cve elvis for CAN assignment searches + Rewrite debian/copyright properly -- Thomas Smith <[email protected]> Wed, 20 Apr 2005 17:00:59 -0500 surfraw (2.0.2-2) unstable; urgency=low * Applied Brian Mcdonald's workaround for bash bug (Closes: #269982) -- Christian Surchi <[email protected]> Mon, 13 Sep 2004 16:34:53 +0100 surfraw (2.0.2-1) unstable; urgency=low * Several patches from Justin B Rye: + Add bash completion (Closes: #240629) + Add some missing elvis in surfraw_elvi.list (Closes: #241079) + Don't set DISPLAY when in text-only mode (Closes: #235251) + Correctly test for text-mode in w3_browse_url() + Readability improvements + Use argv[0] instead of computing it through basename * Removed elvi: + sharereactor: has been closed down * Added French debconf template by Christian Perrier (Closes: #236088) * Added German debconf template by Helge Kreutzmann (Closes: #253800) * New elvi: debpts. * man page hyphenation fixes. * debian/control: + Dropped optional last part of Standards-Version. + Changed lynx to lynx-cur in Recommends to avoid confusing apt. + Added po-debconf to Build-Depends-Indep. * debian/rules clean: + enabled config.{guess,sub} update. + remove templates.merged. * HACKING: updated Appendix 1. * surfraw.conf.in: set SURFRAW_graphical_browser to x-www-browser (Closes: #256201) -- Ian Beckwith <[email protected]> Thu, 29 Jul 2004 15:31:10 +0100 surfraw (2.0.1-1) unstable; urgency=low * Moved elvi to /usr/lib/surfraw (Closes: #230276) * Updated docs for new elvi location * Changed man page section for all elvi to 1sr (Closes: #230056) * Fixed surfraw help text (Closes: #230109) * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Updated README with text from new man page. * Added "Copyright (c) 2003, 2004 The Surfraw-Devel Team <[email protected]>" to the list of copyright holders. * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again. * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them (Closes: #231939). * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * Added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * Disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * Synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf -- Ian Beckwith <[email protected]> Tue, 10 Feb 2004 03:33:14 +0000 surfraw (2.0-1) unstable; urgency=low * Ack NMUs. (Closes: #200164, #201229, #209155, #113148, #119357, #131661) * ..and.. (Closes: #149584, #156466, #141243, #154304, #164206, #141242) * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and ebay, pgpkeys and sharereactor, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Closing non-bugs: - Complaint about correct behaviour (Closes: #173714). - Adds functionality already present in debcontents (Closes: #144080). - Obsoleted by sensible-browser (imho) (Closes: #155423). -- Ian Beckwith <[email protected]> Sun, 9 Nov 2003 22:02:44 +0000 surfraw (1.0.7-3) unstable; urgency=low * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. -- Thomas Smith <[email protected]> Thu, 4 Sep 2003 18:09:29 -0500 surfraw (1.0.7-2) unstable; urgency=low * The first "collaborative" release :) * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* -- Christian Surchi <[email protected]> Sat, 16 Aug 2003 17:02:03 +0000 surfraw (1.0.7-1) unstable; urgency=low * New upstream release * New debian/rules with DH_COMPAT=3 too * Elvi: linuxdoc renamed to slinuxdoc translate renamed to stranslate * Removed unuseful scripts in debian directory * Removed emacs settings in changelog -- Christian Surchi <[email protected]> Sat, 2 Mar 2002 23:54:34 +0100 surfraw (1.0.4-1) unstable; urgency=low * New upstream release, surfraw becomes public domain * Support "--" option to end all options (Closes:#113429) * Added elvi for Debian bugs search (Closes:#70109) * Fixed typo (Closes:#100431) * Removed elvi: ircsearch, newscientist (Closes:#113004,#80099) -- Christian Surchi <[email protected]> Thu, 25 Oct 2001 06:56:17 -0400 diff --git a/debian/source/format b/debian/source/format index d3827e7..163aaf8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -1.0 +3.0 (quilt)
JNRowe/surfraw
6326fa71f4b349b820f759c07af81dede56c1aa6
debian: decrease version number to 2.2.9-1~rc1
diff --git a/debian/changelog b/debian/changelog index c81df53..f0938ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,521 +1,521 @@ -surfraw (2.2.9-1) unstable; urgency=low +surfraw (2.2.9-1~rc1) unstable; urgency=low * New upstream version + yandex: Fix bashism (Closes: #690615). + rae: Fix URL (Closes: #680138). * Standards-Version: 3.9.4 (no changes). * update debian/copyright. - -- Ian Beckwith <[email protected]> Sun, 06 Oct 2013 05:30:37 +0100 + -- Ian Beckwith <[email protected]> Sun, 27 Oct 2013 14:44:46 +0000 surfraw (2.2.8-1) unstable; urgency=low * New upstream version + SURFRAW_graphical_remote defaults to off, as chromium doesn't support '-remote openURL()' (Closes: #628683). * Move opensearch elvi to main surfraw package. It now has an optional mode that uses a redirector if the dependencies are not installed. * debian/rules: + hardcode AWK as awk (Closes: #608967). + use dh_prep instead of dh_clean -k. + add build-arch and build-indep targets. * debian/control: + Build-Depends: bump debhelper dependency to (>= 7). + Standards-Version: 3.9.2. + surfraw-extra: convert Conflicts: to Breaks:. + surfraw: * Breaks: surfraw-extra (<= 2.2.7-1) as we have taken over /usr/lib/surfraw/opensearch. * Recommends: surfraw-extra: add version of (>> 2.2.7-1). * Tweak Description. * debian/source/format: explicitly specify 1.0 source format. -- Ian Beckwith <[email protected]> Tue, 12 Jul 2011 01:31:52 +0100 surfraw (2.2.7-1) unstable; urgency=low * New upstream version. + fixed imdb elvi (Closes: #577263). * Standards-Version: 3.8.4 (no changes). * Add ${misc:Depends} to dependencies. -- Ian Beckwith <[email protected]> Fri, 16 Apr 2010 20:43:27 +0100 surfraw (2.2.6-1) unstable; urgency=low * New upstream version. + Only use first matching bookmark (Closes: #530786). + Fix debsec (patch from Moritz Muehlenhoff) (Closes: #550741). * Remove Moritz from Uploaders (per #550741), thanks for your work!. * debian/rules: call dh_installexamples to install examples/ dir. * debian/control: + update vcs- fields to point to new git repo. + Standards-Version: 3.8.3 (No changes). + add Recommends: curl | wget | libwww-perl for -o. + Remove Conflicts/Replaces: surfaw, this transition was complete many releases ago. -- Ian Beckwith <[email protected]> Fri, 20 Nov 2009 03:34:34 +0000 surfraw (2.2.5-1) unstable; urgency=low * New upstream version. * Removed Thomas Smith from Uploaders (Closes: #519378). Thanks for your work!. * Updated my email address in Uploaders. * Fixed VCS-Browser URL (Closes: #528299). * Removed DM-Upload-Allowed header. * Standards-Version: 3.8.1 (no changes). -- Ian Beckwith <[email protected]> Wed, 13 May 2009 02:09:49 +0100 surfraw (2.2.4-1) unstable; urgency=low * New upstream version. * postrm: add 'set -e'. * debian/copyright: + Update copyright years to include 2009. + point to right GPL link (NB only the file 'missing' is GPLed, most of the package is PD). -- Ian Beckwith <[email protected]> Sun, 01 Mar 2009 02:30:59 +0000 surfraw (2.2.3-1) unstable; urgency=low * New upstream version. + Now defaults to graphical mode, see surfraw(1) for how to change it back. * Change default text browser to www-browser and default graphical browser to sensible-browser. -- Ian Beckwith <[email protected]> Tue, 26 Aug 2008 22:36:24 +0100 surfraw (2.2.2-3) unstable; urgency=low * Backport slinuxdoc fix from 2.2.3 prerelease. -- Ian Beckwith <[email protected]> Fri, 25 Jul 2008 05:14:30 +0100 surfraw (2.2.2-2) unstable; urgency=medium * google: fix bashism and quote more variable expansions (Closes: #489902). Thanks to Philip Armstrong and John Briggs. * Reformat debian/copyright to keep lintian happy. -- Ian Beckwith <[email protected]> Sat, 19 Jul 2008 00:50:33 +0100 surfraw (2.2.2-1) unstable; urgency=low * New upstream version: + fix url escaping (Closes: #487430). + surfraw-update-path: fix csh support (Closes: #484871). * Recommends: Drop w3m-ssl (folded into w3m) and lynx-cur (not in lenny) (Closes: #471359). * surfraw-extra: improve long description (Closes: #471321). * Standards-Version: 3.8.0 (no changes). * Remove linda override. * Add watch file. -- Ian Beckwith <[email protected]> Thu, 03 Jul 2008 01:22:36 +0100 surfraw (2.2.1-2) unstable; urgency=low * Remove my old email address from Uploaders. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:35 +0000 surfraw (2.2.1-1) unstable; urgency=low * New upstream release. + bashisms removed (Closes: #465361, #468139). * debian/rules: move .deb building to binary-indep: target. * debian/compat: bump to 6. * debian/control: + DM-Upload-Allowed: yes merged from Debian-only 2.1.7-1 (see below). Dropped XS- prefix, no longer needed. + Recommends: add elinks | elinks-lite to existing browser alternatives. + Uploaders: update my email address. + Standards-Version: 3.7.3 (no changes). + Build-Depends: Bump debhelper version to >= 6. + Vcs-Cvs/Vcs-Browser: remove XS- prefix and -d workaround. + Homepage: added. * debian/changelog: merged Moritz's debian-only 2.1.7 release changelog. * debian/linda.overrides: remove exec-not-elf-or-script tag now file(1) is fixed. * debian/copyright: update, use machine-interpretable format. -- Ian Beckwith <[email protected]> Tue, 11 Mar 2008 14:07:08 +0000 surfraw (2.2.0-1) UNRELEASED; urgency=low * Actual first new upstream release. See changelog.gz for upstream changes, like a normal package. * debian/rules: Use $(CURDIR) instead of `pwd`. * debian/copyright: updated copyright dates. -- Ian Beckwith <[email protected]> Tue, 11 Sep 2007 03:41:09 +0100 surfraw (2.1.8-1) UNRELEASED; urgency=low * First proper upstream release of the surfraw-devel version. After this release non-debian changes will be logged in the upstream changelog.gz. * Split off opensearch into new package: surfraw-extra as it has a huge dependency tree that not everyone will want to install. * Fixed "sr -options bookmark" (excessive quoting). * New elvi: + archpkg - search Arch Linux packages. Thanks to Simon Ernst. + port - look up a TCP/UDP port on seifried.org/security/ports. * Fixed elvi + debbugs: fixed help formatting. + debcontents - new options * Fixed tests: + austlii - (since when does a legal db not contain "tort"?). + deblists - -security-announce not indexed (#440347), so we search for WNPP posts on -devel. + debpackages. + sunsolve - added cookie to accept license. + w3html - validator will not validate itself. * runtests (see test/README): + Added cookie support. + Added support for skipping tests with SKIP. + Abort if libwww-perl not installed. + Documented changes in test/README. * Makefile.am: removed debian/ files from EXTRA_DIST, they should be in the debian patch not the main tarball. * Bumped debhelper compat level to 5. * Really updated to automake-1.10. * Updated AUTHORS, NEWS, README, HACKING, ChangeLog, NEWS.Debian. -- Ian Beckwith <[email protected]> Fri, 07 Sep 2007 00:18:38 +0100 surfraw (2.1.7) unstable; urgency=low * Add "XS-DM-Upload-Allowed: yes", so that Ian can upload further updates on his own. -- Moritz Muehlenhoff <[email protected]> Sun, 13 Jan 2008 23:23:30 +0100 surfraw (2.1.6) unstable; urgency=low * New elvi: + codesearch - search google code search. + debwiki - search wiki.debian.org and women.debian.org/wiki. + lastfm - search last.fm. + musicbrainz - search musicbrainz.org. + opensearch - search sites that provide an OpenSearch description: - Install helper scripts opensearch-discover and opensearch-genquery to /usr/bin. - Add Dependencies on libwww-opensearch-perl, libwww-perl and libhtml-parser-perl. - Makefile.am: replaced explicit rule for surfraw-update-path.1 with a static pattern rule for making man pages from perl scripts. * Fixed elvi: + amazon - fixed example usage. + cia - switched to https. + cite - fixed URL and options. + debpackages - updated ubuntu distro names. + debcontents - updated ubuntu distro names. + freebsd - fixed help formatting. + netbsd - fixed mailing list searches. + openbsd - fixed PR search URL. + slinuxdoc - fixed URLs. + sundocs - fixed URLs. + woffle - updated URLs to match woffle 2.9a. * Removed elvi: jake - site shut down January 2007. * Implemented test suite - 'make test' or see test/README. * Fixed make distcheck. * Updated to automake 1.10. * debian/rules: stopped ignoring return code of 'make distclean'. * Updated Copyright dates to 2007. * Add Vcs-Cvs and Vcs-Browser fields to debian/control. -- Ian Beckwith <[email protected]> Sat, 30 Jun 2007 22:15:14 +0100 surfraw (2.1.5) unstable; urgency=low * Added myself to Uploaders. * Ack not-really-NMU (Closes: #354737). * Applied bash completion fixes, thanks to Justin B. Rye (Closes: #361668). * wikipedia: disable requoting; use Go rather than Search. * Fixes to ixquick elvi, thanks to Aparna Jaitly. * debpackages/debcontents: new options + ubuntu support with -u. * New elvi: scholar - search google scholar. * New elvi: discogs, thanks to Patroklos Argyroudis. * Thanks to James Rowe for the following patches: + Move W to /usr/lib/surfraw (see http://bugs.gentoo.org/show_bug.cgi?id=58955). + New elvi: genpkg for Gentoo package search. + Generate elvi list on demand and eliminate surfraw_elvi.list + Make elvidir configurable. + Make sysconfdir configurable. + Fix 'make dist' and 'make distcheck'. + Remove unused browser checks. + Drop AC_CANONICAL_HOST - not needed. * New global option: -p / -print: just print search url. * Remove config.guess and config.sub - not needed. * Remove config.{guess,sub} updating logic from debian/rules. * postrm: remove /etc/surfraw_elvi.list if it exists. * Convert debhelper Build-Depends-Indep: to Build-Depends:. * Standards-Version: 3.7.2 (No changes). * Updated Copyright dates to 2006. * Added linda override exec-not-elf-or-script for /usr/bin/surfraw due to erroneous file(1) output (See: #369977). * Tweak HACKING appendix 1 to remove need to build surfraw_elvi.list. -- Ian Beckwith <[email protected]> Tue, 26 Sep 2006 04:22:53 +0100 surfraw (2.1.4) unstable; urgency=low * Ian Beckwith <[email protected]>: + changed elvi: - debsec: fix tabbing (Closes: #354737). - debbugs: updated search options. + new elvi: - ixquick (Thanks to Aparna Jaitly). - ctan. - fsfdir. - gutenberg. - wayback. + Makefile.include: changed sed invocation to work with both old and new make(1). + debian/rules install: removed spurious mkdir. + removed debian/{prerm,postinst}. + Switched to debhelper compat level 4. + HACKING: corrected appendix 1. -- Ian Beckwith <[email protected]> Fri, 17 Mar 2006 22:26:37 +0000 surfraw (2.1.3) unstable; urgency=high * Urgency high, as it renders surfraw uninstallable * Really, really remove debconfage (Closes: #354263) -- Moritz Muehlenhoff <[email protected]> Fri, 24 Feb 2006 23:00:09 +0100 surfraw (2.1.2) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Fix FTBFS due to make changes (Patch by Matt Kraai) (Closes: 353314) + Fix zsh completion for yubnub (Patch by Micah Anderson) (Closes: #341872) + Remove debian/po to prevent further translations in vain. Sorry for the wasted work on the Swedish translation, Daniel Nylander! (Closes: #338149, #336687) + Changed maintainer address to "Debian surfraw maintainers", added Christian, Thomas and myself to uploaders + New elvis: debsec (for the Debian security tracker) -- Moritz Muehlenhoff <[email protected]> Thu, 23 Feb 2006 16:49:55 +0100 surfraw (2.1.1) unstable; urgency=low * Moritz Muehlenhoff <[email protected]>: + Removed debconf information about new elvi structure, now that Sarge has been released with it. Moved it to README.Debian. (Closes: #313852, #312979, #319841, #319842) + New elvis: yubnub (by Iain D Broadfoot) (Closes: #315188) + Removed unused SURFRAW_p0rn option (Closes: #324166) + Bumped standards version (no changes required) + Change to a native package, most of the elvis are now more or less Debian specific anyway -- Moritz Muehlenhoff <[email protected]> Fri, 29 Apr 2005 16:20:39 +0200 surfraw (2.1.0-1) unstable; urgency=medium * Ian Beckwith <[email protected]>: + New elvi: dmoz, w3html, w3link, w3css, w3rdf. + New elvi: rae (by Ruben Pollan <[email protected]>). + surfraw.IN:w3_url_escape: escaped `(' and `)'. + Fixed elvi (Thanks to Justin B. Rye): - sunsolve (Closes: #289502). - altavista (Closes: #289503). + deblists: Updated list of debian mailing lists. + currency: Now a proper elvis. + Added appendix 2 to HACKING on preparing a release. * Moritz Muehlenhoff <[email protected]>: + Switch rhymes search from Lycos to Rhymezone (by Justin B Rye) (Closes: #289498) + Fix BBC News search (by Justin B Rye) (Closes: #289499) + New elvi by by Justin B Rye (Closes: #290032) - cia Search for CIA documents - deblogs Debian changelogs - etym Search for word origins - foldoc Free online dictionary of computing + New cve elvis for CAN assignment searches + Rewrite debian/copyright properly -- Thomas Smith <[email protected]> Wed, 20 Apr 2005 17:00:59 -0500 surfraw (2.0.2-2) unstable; urgency=low * Applied Brian Mcdonald's workaround for bash bug (Closes: #269982) -- Christian Surchi <[email protected]> Mon, 13 Sep 2004 16:34:53 +0100 surfraw (2.0.2-1) unstable; urgency=low * Several patches from Justin B Rye: + Add bash completion (Closes: #240629) + Add some missing elvis in surfraw_elvi.list (Closes: #241079) + Don't set DISPLAY when in text-only mode (Closes: #235251) + Correctly test for text-mode in w3_browse_url() + Readability improvements + Use argv[0] instead of computing it through basename * Removed elvi: + sharereactor: has been closed down * Added French debconf template by Christian Perrier (Closes: #236088) * Added German debconf template by Helge Kreutzmann (Closes: #253800) * New elvi: debpts. * man page hyphenation fixes. * debian/control: + Dropped optional last part of Standards-Version. + Changed lynx to lynx-cur in Recommends to avoid confusing apt. + Added po-debconf to Build-Depends-Indep. * debian/rules clean: + enabled config.{guess,sub} update. + remove templates.merged. * HACKING: updated Appendix 1. * surfraw.conf.in: set SURFRAW_graphical_browser to x-www-browser (Closes: #256201) -- Ian Beckwith <[email protected]> Thu, 29 Jul 2004 15:31:10 +0100 surfraw (2.0.1-1) unstable; urgency=low * Moved elvi to /usr/lib/surfraw (Closes: #230276) * Updated docs for new elvi location * Changed man page section for all elvi to 1sr (Closes: #230056) * Fixed surfraw help text (Closes: #230109) * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Updated README with text from new man page. * Added "Copyright (c) 2003, 2004 The Surfraw-Devel Team <[email protected]>" to the list of copyright holders. * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again. * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them (Closes: #231939). * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * Added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * Disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * Synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf -- Ian Beckwith <[email protected]> Tue, 10 Feb 2004 03:33:14 +0000 surfraw (2.0-1) unstable; urgency=low * Ack NMUs. (Closes: #200164, #201229, #209155, #113148, #119357, #131661) * ..and.. (Closes: #149584, #156466, #141243, #154304, #164206, #141242) * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and ebay, pgpkeys and sharereactor, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Closing non-bugs: - Complaint about correct behaviour (Closes: #173714). - Adds functionality already present in debcontents (Closes: #144080). - Obsoleted by sensible-browser (imho) (Closes: #155423). -- Ian Beckwith <[email protected]> Sun, 9 Nov 2003 22:02:44 +0000 surfraw (1.0.7-3) unstable; urgency=low * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. -- Thomas Smith <[email protected]> Thu, 4 Sep 2003 18:09:29 -0500 surfraw (1.0.7-2) unstable; urgency=low * The first "collaborative" release :) * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* -- Christian Surchi <[email protected]> Sat, 16 Aug 2003 17:02:03 +0000 surfraw (1.0.7-1) unstable; urgency=low * New upstream release * New debian/rules with DH_COMPAT=3 too * Elvi: linuxdoc renamed to slinuxdoc translate renamed to stranslate * Removed unuseful scripts in debian directory * Removed emacs settings in changelog -- Christian Surchi <[email protected]> Sat, 2 Mar 2002 23:54:34 +0100 surfraw (1.0.4-1) unstable; urgency=low * New upstream release, surfraw becomes public domain * Support "--" option to end all options (Closes:#113429) * Added elvi for Debian bugs search (Closes:#70109) * Fixed typo (Closes:#100431) * Removed elvi: ircsearch, newscientist (Closes:#113004,#80099) -- Christian Surchi <[email protected]> Thu, 25 Oct 2001 06:56:17 -0400
JNRowe/surfraw
5943f3a4b89935423a0843c03e2ddd0a6b829579
surfraw.IN: w3_custom_search_google: don't give full path to surfraw; wayback,pgdoc: fix tests
diff --git a/ChangeLog b/ChangeLog index 889949b..14a0247 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,517 @@ +2013-10-27 Ian Beckwith <[email protected]> + + * surfraw.IN: w3_custom_search_google: don't give full path to surfraw. + * pgdoc, wayback: fixed tests. + 2013-10-20 Ian Beckwith <[email protected]> * new elvi: yacy: search using yacy p2p search. -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. * netbsd: new option -ps to search ports * openbsd: new option -ps to search ports * URLs for *bsd portsearch, finkpkg, macports and rpmsearch from whohas(1), http://www.philippwesche.org/200811/whohas/intro.html diff --git a/surfraw.IN b/surfraw.IN index fa3f472..a9daca1 100755 --- a/surfraw.IN +++ b/surfraw.IN @@ -5,689 +5,689 @@ # <[email protected]> # Copyright (c) 2000-2001 Julian Assange, placed into the public domain # Copyright (c) 2000 Melbourne Institute for Advanced Study, placed into the public domain # # see the file COPYING for further copyright details # surfraw_version=@VERSION@ surfraw_api_version=1.0 w3_argv0=`basename "$0"` elvidir="@ELVIDIR@" # defaults w3_config_hook () { return 1 } find_global_conf () { base="$1" local conf OIFS conf="" if test -n "$XDG_CONFIG_DIRS"; then OIFS="$IFS" IFS=: set $XDG_CONFIG_DIRS IFS="$OIFS" for i in "$@"; do if test -r "$i/surfraw/$base"; then conf="$i/surfraw/$base" break fi done elif test -r "@sysconfdir@/xdg/surfraw/$base"; then # XDG default conf="@sysconfdir@/xdg/surfraw/$base" elif test -r "@sysconfdir@/surfraw.$base"; then # old surfraw default conf="@sysconfdir@/surfraw.$base" fi echo "$conf" } load_global_conf () { local conf if test -n "$SURFRAW_global_conf" && test -r "$SURFRAW_global_conf"; then conf="$SURFRAW_global_conf" else conf=$(find_global_conf conf) fi if test -z "$conf" || ! test -r "$conf"; then err "couldn't find global config in @sysconfdir@/xdg/surfraw/conf or \$XDG_CONFIG_DIRS" fi . "$conf" } find_local_conf () { base="$1" if test -n "$XDG_CONFIG_HOME" && test -r "$XDG_CONFIG_HOME/surfraw/$base"; then echo "$XDG_CONFIG_HOME/surfraw/$base" elif test -n "$HOME"; then if test -r "$HOME/.config/surfraw/$base"; then echo "$HOME/.config/surfraw/$base" elif test -r "$HOME/.surfraw.$base"; then echo "$HOME/.surfraw.$base" fi fi } load_local_conf () { local conf conf="" if test -n "$SURFRAW_conf" && test -r "$SURFRAW_conf"; then conf="$SURFRAW_conf" else conf="$(find_local_conf conf)" fi if test -n "$conf" && test -r "$conf"; then . $conf fi } get_local_elvi_dir () { if test -n "$XDG_CONFIG_HOME";then echo "$XDG_CONFIG_HOME/surfraw/elvi" elif test -n "$HOME";then echo "$HOME/.config/surfraw/elvi" fi } w3_config () { load_global_conf w3_config_hook load_local_conf } warn () { echo "$w3_argv0 WARNING: ""$@" >&2 } err () { echo "$w3_argv0 ERROR: ""$@" >&2 exit 1 } yesno () { eval value=\$${1} case `echo "$value" | tr A-Z a-z` in yes|true|on|1) return 0 ;; no|false|off|0) return 1 ;; *) err "\"$1\" is not set correctly. Should be (yes|on|1|no|off|0). Is \"$value\"" ;; esac } ifyes () { yesno "$@" && return 0 return 1 } ifno () { yesno "$@" && return 1 return 0 } ok () { yesno "$@" } null () { test -z "$@" && return 0 return 1 } def () { eval value=\$${1} test -z "$value" || return 0 eval ${1}="$2" return 0 } defyn () { eval value=\$${1} test -z "$value" && eval ${1}="$2" yesno "$1" } setopt () { eval value=\$${1} eval ${1}="$2" } setoptyn () { eval value=\$${1} eval ${1}="$2" yesno "$1" } quote_ifs () { if [ -z "$1" ]; then return; fi perl -e '$ifs=$ENV{IFS} || " "; $arg=shift;if($arg =~/[$ifs]/) { $arg="\"$arg\""; } print "$arg\n"; ' -- "$1" } bookmark_file_search () { search="$1" file="$2" if [ -r "$file" ] then @AWK@ -v search="$search" '$1 == search { for (nLoop = 2;nLoop <= NF; nLoop++) printf("%s ", $nLoop); print ""; }' $file | head -n 1 fi } bookmark_lookup () { search="$1" file=$(find_local_conf bookmarks) lookup=$(bookmark_file_search "$search" "$file") if [ -z "$lookup" ] then file=$(find_global_conf bookmarks) lookup=$(bookmark_file_search "$search" "$file") fi if [ -n "$lookup" ] then echo "$lookup" fi } w3_find_prog () { prog="$1" old_ifs="${IFS:-\" \"}" IFS=":" path_ifs="$PATH" for dir in $path_ifs; do test -z "$dir" && dir=. if test -e "$dir/$prog"; then echo "$dir/$prog" IFS="$old_ifs" return 0 fi done IFS="$old_ifs" return 1 } w3_url_escape () { echo "$@" | sed 's/%/%25/g; s/+/%2B/g; # s/ /+/g; s/ /%20/g; s/(/%28/g; s/)/%29/g; s/"/%22/g; s/#/%23/g; s/\$/%24/g; s/&/%26/g; s/,/%2C/g; # s/\./%2E/g; sx/x%2Fxg; s/:/%3A/g; s/;/%3B/g; s/</%3C/g; s/=/%3D/g; s/>/%3E/g; s/?/%3F/g; s/@/%40/g; s/\[/%5B/g; s/\\/%5C/g; s/\]/%5D/g; s/\^/%5E/g; s/{/%7B/g; s/|/%7C/g; s/}/%7D/g; s/~/%7E/g; s/`/%60/g; '"s/'/%27/g" } w3_url_of_arg () { if ok SURFRAW_quote_args; then args=\""$@"\" else args="$@" fi if ok SURFRAW_escape_url_args; then w3_url_escape "$args" else echo "$args" fi } true () { return 0 } false () { return 1 } w3_global_usage () { defyn SURFRAW_local_help no if ifyes SURFRAW_local_help; then return; fi # style: keep sorted #-------------------------------------79 cols---------------------------------- cat <<EOF Global options: -bookmark-search-elvis=ELVIS If args are passed to a non-searchable bookmark, search with this elvis instead. Default: $SURFRAW_bookmark_search_elvis Environment: SURFRAW_bookmark_search_elvis -browser=EXECUTABLE Set browser Default: $SURFRAW_browser -custom-search=PROVIDER Use PROVIDER for custom searches. Supported: google, duckduckgo Default: $SURFRAW_customsearch_provider Environment: SURFRAW_customsearch_provider -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: $SURFRAW_escape_url_args Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: $SURFRAW_graphical Environment: SURFRAW_graphical -h | -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: $SURFRAW_new_window Environment: SURFRAW_new_window -ns[=yes|no] Start in a new screen | -newscreen[=yes|no] Default: $SURFRAW_new_screen Environment: SURFRAW_new_screen -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: $SURFRAW_quote_args Environment: SURFRAW_quote_args -version Display Surfraw version ($surfraw_version) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study EOF } w3_usage_hook () { echo "Usage: $w3_argv0 [options] [args...]" w3_global_usage } w3_bad_option () { err "bad option \"${opt}\". Try ${w3_argv0} -help for usage information" } w3_parse_option_hook () { return 1 } list_elvi() { local dir="$1" sed -n 's/^.*elvis:[ ]\+\(.*\)$/\1/p' $(find "$dir" ! -type d ! -type l ! -name '*~' | sort) for script in $(find "$dir" ! -type d -type l | sort) ; do printf '%-16s--> %s\n' $(basename "$script") $(basename $(readlink "${script}")) done } w3_parse_option () { opt="$1" case "$opt" in -*=*) optarg=`echo "$opt" | sed 's/[-_a-zA-Z0-9]*=//'` esac w3_parse_option_hook "$opt" "$optarg" && return 0 case "$opt" in -bookmark-search-elvis=*) setopt SURFRAW_bookmark_search_elvis $optarg ;; -browser=*) setopt SURFRAW_browser $optarg ;; -elvi) echo " GLOBAL ELVI:" list_elvi "$elvidir" localelvidir=$(get_local_elvi_dir) if [ -d "$localelvidir" ] && [ -n "$(ls "$localelvidir")" ]; then echo " LOCAL ELVI:" list_elvi "$localelvidir" fi exit 0 ;; -escape-url-args=*) setoptyn SURFRAW_escape_url_args $optarg ;; -g | -graphical) setoptyn SURFRAW_graphical yes ;; -help | --help |-h) do_help=1 ;; -local-help | \ --local-help |-lh ) do_help=1 ;setoptyn SURFRAW_local_help yes ;; -q | -quote) setoptyn SURFRAW_quote_args yes ;; -new) setoptyn SURFRAW_new_window yes ;; -new=*) setoptyn SURFRAW_new_window $optarg ;; -ns | -newscreen) setoptyn SURFRAW_new_screen yes ;; -ns=* | -newscreen=*) setoptyn SURFRAW_new_screen $optarg ;; -custom-search=*) setopt SURFRAW_customsearch_provider $optarg ;; -o) setoptyn SURFRAW_dump yes ;; -o=*) setoptyn SURFRAW_dump yes setopt SURFRAW_dump_file $optarg ;; -t | -text) unset DISPLAY setoptyn SURFRAW_graphical no ;; -version) echo $surfraw_version; exit 0 ;; -p | -print) setoptyn SURFRAW_print yes ;; --) setoptyn SURFRAW_end_of_args yes ;; -*) w3_bad_option "$opt" ;; *) return 1 ;; esac return 0 } w3_parse_args () { w3_args= w3_shquoted_args= def SURFRAW_browser none def SURFRAW_browser_args none defyn SURFRAW_quote_ifs yes defyn SURFRAW_end_of_args no do_help=0 mode=unknown for arg in "$@"; do isarg=1 if ifno SURFRAW_end_of_args then w3_parse_option "$arg" isarg=$? fi if [ $isarg -eq 1 ] then if [ -z "$w3_shquoted_args" ] then w3_shquoted_args="`quote "$arg"`" else w3_shquoted_args="$w3_shquoted_args `quote "$arg"`" fi if ok SURFRAW_quote_ifs then arg=`quote_ifs "$arg"` fi if [ -n "$w3_args" ] then w3_args="$w3_args $arg" else w3_args="$arg" fi fi done if test $SURFRAW_browser = none; then if ok SURFRAW_graphical && test -n "$DISPLAY"; then SURFRAW_browser=$SURFRAW_graphical_browser SURFRAW_browser_args=$SURFRAW_graphical_browser_args mode=graphical else SURFRAW_browser=$SURFRAW_text_browser SURFRAW_browser_args=$SURFRAW_text_browser_args mode=text fi fi if ok do_help; then w3_usage_hook exit 0 fi } w3_dump () { if test -z "$SURFRAW_dump_file"; then SURFRAW_dump_file="-" fi if test -x "$(which curl)"; then curl -o "$SURFRAW_dump_file" "$@" elif test -x "$(which wget)"; then wget -q -O "$SURFRAW_dump_file" "$@" elif test -x "$(which GET)"; then if test "$SURFRAW_dump_file" = "-"; then GET "$@" else GET "$@" > "$SURFRAW_dump_file" fi else err "No URL fetcher found: install curl, wget or libwww-perl" fi } w3_browse_url () { if ok SURFRAW_new_screen && test `echo $TERM | cut -c 1-6` = "screen" && test $mode = text; then screen=yes else screen=no fi if ok SURFRAW_dump; then w3_dump "$@" elif ok SURFRAW_print; then echo "$@" elif ok screen; then if [ "$SURFRAW_screen" = "tmux" ]; then if test "$SURFRAW_browser_args" = "none"; then $SURFRAW_screen $SURFRAW_screen_args "$SURFRAW_browser \"$@\"" else $SURFRAW_screen $SURFRAW_screen_args "$SURFRAW_browser $SURFRAW_browser_args \"$@\"" fi else if test $SURFRAW_browser_args = "none"; then $SURFRAW_screen $SURFRAW_screen_args $SURFRAW_browser "$@" else $SURFRAW_screen $SURFRAW_screen_args $SURFRAW_browser $SURFRAW_browser_args "$@" fi fi else if ok SURFRAW_graphical_remote && test $mode = graphical; then if ok SURFRAW_new_window; then newwin=", new-window" else newwin="" fi if test $SURFRAW_browser_args = "none"; then $SURFRAW_browser -remote "openURL($*$newwin)" 2>/dev/null || $SURFRAW_browser "$@" & else $SURFRAW_browser -remote "openURL($*$newwin)" 2>/dev/null || $SURFRAW_browser $SURFRAW_browser_args "$@" & fi else if test $SURFRAW_browser_args = "none"; then $SURFRAW_browser "$@" else $SURFRAW_browser $SURFRAW_browser_args "$@" fi fi fi } w3_custom_search_usage() { echo "Custom search:" echo " To choose which search engine gets used for custom searches," echo " configure SURFRAW_customsearch_provider" echo " or use -custom-search=PROVIDER" echo " supported: google, duckduckgo" echo " default: $SURFRAW_customsearch_provider" } w3_custom_search() { case "$SURFRAW_customsearch_provider" in google) w3_custom_search_google "$@" ;; duckduckgo) w3_custom_search_duckduckgo "$@" ;; ixquick) w3_custom_search_ixquick "$@" ;; *) w3_custom_search_duckduckgo "$@" ;; esac } w3_custom_search_google() { params=$(eval w3_custom_search_mangle -s site: $*) params=$(eval w3_custom_search_mangle -u inurl: $params) params=$(eval w3_custom_search_inurl_quote_dots $params) - url="$(eval /usr/bin/surfraw google -p $params )" + url="$(eval surfraw google -p $params )" w3_browse_url "$url" } w3_custom_search_duckduckgo() { params=$(eval w3_custom_search_mangle -s site: $*) params=$(eval w3_custom_search_mangle -u inurl: $params) url="$(eval surfraw duckduckgo -p $params )" w3_browse_url "$url" } w3_custom_search_ixquick() { params=$(eval w3_custom_search_mangle -s host: $*) params=$(eval w3_custom_search_mangle -u url: $params) url="$(eval surfraw ixquick -p $params )" w3_browse_url "$url" } w3_custom_search_mangle() { search="$1" replace="$2" shift shift for arg in "$@" do quote "$(echo "$arg" | sed "s/^${search}=\(.*\)/${replace}\1/")" done } w3_custom_search_inurl_quote_dots() { for arg in "$@" do if echo "$arg" | grep -q -- inurl: then quote "$(echo "$arg" | sed 's/\./\\./g;')" else quote "$arg" fi done } quote () { quoted=`echo "$1"|sed "s/'/'\\\\\''/g"` echo "'$quoted'" } surfraw_usage() { cat <<EOF Usage: $w3_argv0 [-help] [-elvi] elvis [elvioptions] [search terms] $w3_argv0 [options] bookmark [search terms] If you wish to run the elvi directly, run "surfraw-update-path" to append $elvidir to your \$PATH in your shell's config files. See surfraw-update-path(1) for details Options: -elvi List elvi -help This help sr is an alias for surfraw EOF w3_global_usage } # Browse URL or perform a search on URL(s) if search terms # are provided (use the user's elvis of choice if URL has no # %s field or multiple if multiple URLs are provided) parse_bookmark() { if [ -z "$w3_args" ]; then case "$bookmark" in *"%s"*) # Keep only the domain address, the rest contains %s which should be filtered. bookmark=$(echo $bookmark | @AWK@ -F '/' '{print $1 "//" $3}') ;; *) # Keep the first URL (if multiple-URL bookmark) as-is, no %s here... bookmark=$(echo $bookmark | cut -f 1 -d ' ') ;; esac else escaped_args=$(w3_url_of_arg $w3_args) case "$bookmark" in *"%s"*) bookmark="$(echo $bookmark | sed "s|\%s|$escaped_args|")" ;; *) [ -z $SURFRAW_bookmark_search_elvis ] && SURFRAW_bookmark_search_elvis=google bookmark=$(echo $bookmark | sed -e 's|^|site:|' \ -e 's|\ |\ OR\ site:|g' \ -e "s|^|$w3_args |" \ -e "s|^|$SURFRAW_bookmark_search_elvis |") ;; esac fi echo $bookmark } if [ "$w3_argv0" = "surfraw" -o "$w3_argv0" = "sr" ] then w3_config opts="" unquoted_opts="" unquoted_searchterms="" elvi="" searchterms="" do_help=0 for arg in "$@" do # if it is an option if [ "$(echo "$arg" | sed 's/^\(.\).*/\1/;' )" = "-" ] then # if option before elvi if [ -z "$elvi" ] then case "$arg" in -help | --help |-h) do_help=1 ;; -local-help | \ --local-help | \ -lh | -\? ) do_help=1 ; setoptyn SURFRAW_local_help yes ;; -elvi*) w3_parse_option -elvi; exit 0 ;; esac fi if ok do_help then surfraw_usage exit 0 fi if [ -z "$opts" ] then opts="`quote "$arg"`" unquoted_opts="$arg" else opts="$opts `quote "$arg"`" unquoted_opts="$unquoted_opts $arg" fi elif [ -z "$elvi" ] then elvi="$arg" else if [ -z "$searchterms" ] then searchterms="`quote "$arg"`" unquoted_searchterms="$arg" else searchterms="$searchterms `quote "$arg"`" unquoted_searchterms="$unquoted_searchterms $arg" fi fi done if [ -z "$elvi" ] then surfraw_usage exit 0 else localelvidir=$(get_local_elvi_dir) if [ -x "$localelvidir/$elvi" ] then sh -c "$localelvidir/$elvi $opts $searchterms" elif [ -x "$elvidir/$elvi" ] then sh -c "$elvidir/$elvi $opts $searchterms" else bookmark=`bookmark_lookup $elvi` if [ -n "$bookmark" ] then w3_parse_args $unquoted_opts $unquoted_searchterms bookmark=$(parse_bookmark) w3_browse_url "$bookmark" exit 0 else echo "`basename $0`: $elvi: No elvis or bookmark with that name" echo "Passing everything to browser and hoping for the best..." $BROWSER "$elvi $opts $unquoted_searchterms" exit 0 fi fi fi fi diff --git a/test/pgdoc.test b/test/pgdoc.test index 2ffdb8d..d0f0bbd 100644 --- a/test/pgdoc.test +++ b/test/pgdoc.test @@ -1,4 +1,4 @@ SURFRAW_customsearch_provider=duckduckgo pgdoc select SELECT.*DISTINCT SURFRAW_customsearch_provider=duckduckgo pgdoc -v=9.1 select -The syntax of the RETURNING list +Documentation: 9.1 diff --git a/test/wayback.test b/test/wayback.test index 6adfc97..bce6ba5 100644 --- a/test/wayback.test +++ b/test/wayback.test @@ -1,2 +1,2 @@ wayback http://www.debian.org -has been crawled.*going all the way back to +Saved.*[\d,]+.*times
JNRowe/surfraw
67f998fd7cb8cf3f78b941b2fb6bbace565eed07
yacy.test: add to Makefile.am
diff --git a/test/Makefile.am b/test/Makefile.am index 0077b7f..a59f92d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,35 +1,35 @@ EXTRA_DIST = runtests elviwithouttests README COOKIES W.test \ acronym.test ads.test alioth.test amazon.test archpkg.test \ archwiki.test arxiv.test ask.test aur.test austlii.test \ bbcnews.test bing.test bookfinder.test bugmenot.test \ bugzilla.test cablesearch.test cia.test cisco.test cite.test \ cliki.test cnn.test codesearch.test comlaw.test ctan.test \ currency.test cve.test debbugs.test debcodesearch.test \ debcontents.test deblists.test deblogs.test debpackages.test \ debpkghome.test debpts.test debsec.test debvcsbrowse.test \ debwiki.test deja.test deli.test discogs.test dmoz.test \ duckduckgo.test ebay.test etym.test excite.test f5.test \ finkpkg.test foldoc.test freebsd.test freedb.test \ freshmeat.test fsfdir.test gcache.test genbugs.test \ genportage.test github.test google.test gutenberg.test \ imdb.test ixquick.test jamendo.test javasun.test jquery.test \ lastfm.test leodict.test l1sp.test lsm.test macports.test \ mathworld.test mdn.test mininova.test musicbrainz.test \ mysqldoc.test netbsd.test ntrs.test openbsd.test \ openports.test opensearch.test oraclesearch.test pasearch.test \ pgdoc.test phpdoc.test pin.test piratebay.test pgpkeys.test \ priberam.test pubmed.test rae.test rfc.test rhyme.test \ rpmsearch.test scholar.test scicom.test scitopia.test \ scirus.test scpan.test slashdot.test slinuxdoc.test \ sourceforge.test springer.test stack.test stockquote.test \ thesaurus.test translate.test urban.test w3css.test \ w3html.test w3link.test w3rdf.test wayback.test webster.test \ wetandwild.test wikipedia.test wolfram.test woffle.test \ - worldwidescience.test yahoo.test yandex.test youtube.test \ - yubnub.test + worldwidescience.test yacy.test yahoo.test yandex.test \ + youtube.test yubnub.test test: ./runtests ./elviwithouttests
JNRowe/surfraw
ec6fa73f6d90ce1f61588ac7304e444f9b2e28bb
new elvi: yacy
diff --git a/AUTHORS b/AUTHORS index d59b744..e52c4c3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,165 +1,165 @@ AUTHORS Julian Assange <[email protected]> original author Christian Surchi <[email protected]> original debian maintainer elvi: debcontents, debbugs, debpackages Ian Beckwith <[email protected]> current debian maintainer elvi: alioth, bbcnews, bugzilla, deblists, freedb, imdb, scpan, codesearch, debwiki, lastfm, musicbrainz, opensearch, scholar, ctan, fsfdir, gutenberg, wayback, dmoz, w3html, w3link, w3css, w3rdf, debpts, rfc, lsm, finkpkg, rpmsearch, macports, debpkghome, debvcsbrowse, scroogle, scirus, scitopia, worldwidescience, debcodesearch, jquery, mdn, mysqldoc, pgdoc, - oraclesearch, S + oraclesearch, S, yacy plus various tweaks/bugfixes/features. Moritz Muehlenhoff <[email protected]> elvi: debsec, ebay, leodict, wikipedia, sharereactor, pgpkeys, happypenguin plus various patches/maintenance. Thomas Smith <[email protected]> Bugfixes, uploading. Stephen Stafford <[email protected]> Bug fixes Kevin Kreamer <[email protected]> Bug fixes Christian Weisgerber <[email protected]> elvi: fast, thesaurus, webster Jason Harris <[email protected]> elvi: freebsd, openbsd, filesearching, ftpfind Ruben Pollan <[email protected]> elvi: rae Ian Broadfoot <[email protected]> elvi: yubnub James Rowe <[email protected]> plus useful patches/maintenance. Aparna Jaitly <[email protected]> elvi: ixquick Justin B. Rye <[email protected]> elvi: cia, deblogs, etym, foldoc plus useful patches. Patroklos Argyroudis <[email protected]> elvi: discogs Simon Ernst <[email protected]> elvi: archpkg Ivy Foster <[email protected]> elvi: bookfinder, bugmenot plus various patches/maintenance Sumant Oemrawsingh <[email protected]> elvi: cliki, l1sp, mathworth, mininova, youtube plus patches, including the uzbl examples. Sadako <[email protected]> imdb fixes tczy <[email protected]> elvi: bing Simone Fittabile <[email protected]> elvi: acronym, gcache, jamendo plus patches. Micah Anderson <[email protected]> various patches René Reigel <[email protected]> elvi: aur J.R. Mauro <[email protected]> elvi: urban, piratebay, genportage Wim van Hoydonck <[email protected]> elvi: ntrs, springer, sc John Briggs <[email protected]> patch to google John Gruenenfelder <[email protected]> elvi: arxiv csh patch James TD Smith <[email protected]> elvi: javasun google country-specific options Charles Twardy <[email protected]> fixed cia Uspenskiy Andrey <[email protected]> elvi: yandex Jameson Rollins <[email protected]> elvi: ads plus tweaks. Jakob <[email protected]> elvi: pasearch Kyle Isom <[email protected]> elvi: cablesearch, duckduckgo, openports, wolfram plus various fixes/maintenance. Jason Ryan <[email protected]> elvi: archwiki, deli, github, stack, pin plus various fixes/maintenance Sara Fauzia <[email protected]> archpkg fix. Thomas Zervogiannis <[email protected]> Searchable bookmarks. Paulo Almeida <[email protected]> elvi: priberam Shain Singh <[email protected]> elvi: cisco, f5 Manolo Martínez <[email protected]> examples: elinks integration (hooks.lua) Jon Yamokoski <[email protected]> elvi: phpdoc THANKS TO Brian Nelson <[email protected]> Christian Garbs <[email protected]> Hector Blanco <[email protected]> Jeff Bailey <[email protected]> Mark W. Eichin <[email protected]> Teófilo Ruiz Suárez <[email protected]> Maru Dubshinki <[email protected]> Matt Kraai <[email protected]> Brian Mcdonald <[email protected]> Carl Fredrik Hammar <[email protected]> Andy Valencia <[email protected]> Philip Armstrong <[email protected]> Dan Jacobson <[email protected]> Sunil Nimmagadda <[email protected]> Michel <[email protected]> Nikos Apostolakis <[email protected]> Facundo Aguirre <[email protected]> Raphael Geissert <[email protected]> If we've missed anyone, let us know. diff --git a/ChangeLog b/ChangeLog index 58eebca..889949b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,514 +1,516 @@ 2013-10-20 Ian Beckwith <[email protected]> + * new elvi: yacy: search using yacy p2p search. + -S searches ScienceNet, a yacy-based science search engine. * rae: fix url, remove -tipo option (no longer supported), disable test as there is now gratuitous javascript. 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. * netbsd: new option -ps to search ports * openbsd: new option -ps to search ports * URLs for *bsd portsearch, finkpkg, macports and rpmsearch from whohas(1), http://www.philippwesche.org/200811/whohas/intro.html * cia, pubmed: fixed tests. 2009-11-12 Ian Beckwith <[email protected]> diff --git a/NEWS b/NEWS index c1e1463..acabe4f 100644 --- a/NEWS +++ b/NEWS @@ -1,483 +1,484 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha + + yacy - search YaCy P2P search engines, including ScienceNet * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or -custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Debian packaging now included in release, in debian/ dir. * Known problems + fink - down temporarily + deblogs - down (hopefully) temporarily Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$ diff --git a/README b/README index 2102a29..57ec203 100644 --- a/README +++ b/README @@ -1,399 +1,400 @@ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Home Page: http://surfraw.alioth.debian.org ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web New: http://surfraw.alioth.debian.org Old: http://surfraw.sourceforge.net/ Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, babelfish, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with netscape-remote or incremental text browsers, such as links (http://artax.karlin.mff.cuni.cz/~mikulas/links/), w3m (http://www.w3m.org/), and screen(1) a Surfraw liberateur is capable of navigating speeds that leave GUI tainted idolaters agape with fear and wonder. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine. ADDING THE ELVI TO YOUR PATH If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (usually /usr/lib/surfraw or /usr/local/lib/surfraw/) to your path, either manually or using surfraw-update-path(1). CONFIG FILES Surfraw implements the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) Essentially this means global config will be in /etc/xdg/surfraw/ and local config will be in $HOME/.config/surfraw/. This can be modified by setting $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME, see the spec for more details. If your system has a different sysconfdir set during configure, that will be used instead of /etc (for instance, /usr/local/etc). In the documentation below, only the default paths will be referred to. LOCAL ELVI Surfraw can use your own private elvi, store them in $HOME/.config/surfraw/elvi/. Local elvi will be listed separately at the end of 'surfraw -elvi'. Use existing elvi (e.g. google) as a template. If you think your elvi may be useful to others, consider submitting them to [email protected]. BOOKMARKS Surfraw now supports bookmarks. To add a bookmark, add it to to the global bookmark list in /etc/xdg/surfraw/bookmarks or to your personal bookmark list in $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks CUSTOM SEARCH Several elvi use a search engine with site: and inurl: keywords. The search engine used can be customized by setting the environment variable SURFRAW_customsearch_provider or using the command-line argument -customsearch= Currently google and duckduckgo are supported Examples: SURFRAW_customsearch_provider=duckduckgo sr mysqldoc -v=5.5 select sr pgdoc -customsearch=google -v=9.1 select The default is to use duckduckgo. Currently affected elvi: mdn mysqldoc netbsd openbsd pgdoc slinuxdoc INSTALLATION Surfraw is installed with the standard ./configure; make; make install procedure. See INSTALL for more details. If you obtained surfraw direct from the git repository rather than a release tarball, run ./prebuild to generate the autotools build files *before* running ./configure. Note that the opensearch elvis depends on the perl libraries WWW::OpenSearch, HTML::Parser and LWP (libwww-perl). If you don't want to install opensearch, use ./configure --disable-opensearch. Surfraw supports the following options to ./configure: --with-text-browser=BROWSER Use BROWSER as text-mode browser --with-graphical-browser=BROWSER Use BROWSER as graphical-mode browser --with-elvidir=DIR Use DIR as location for storing elvi --disable-opensearch Disable OpenSearch support --disable-sr Disable installing sr alias By default, the text and graphical browsers are detected from a list of installed browsers at configure time. elvidir defaults to $(libdir)/surfraw (probably /usr/local/lib/surfraw). EXAMPLES $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr wikipedia surfraw $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian OPTIONS Global options are common to all Surfraw elvi (clients). You can get a list of the currently installed elvi by just typing `surfraw -elvi'. For example: $ surfraw -elvi GLOBAL ELVI: W -- Activate Surfraw defined web-browser acronym -- Look for acronyms definitions (www.acronymfinder.com) ads -- Search SAO/NASA Astrophysics Data System alioth -- Search Alioth (alioth.debian.org) amazon -- Search the amazon.com bookstore archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/) archwiki -- Search the Arch Linux Wiki arxiv -- Search arXiv E-Print Archive for articles ask -- Question the web using Ask Jeeves (www.ask.com) aur -- Search aur.archlinux.org for PKGBUILDs austlii -- Search Australian Law docs (www.austlii.edu.au) bbcnews -- Search BBC News (news.bbc.co.uk) bing -- Search the web using Microsoft's Bing (www.bing.com) bookfinder -- Search for books using www.bookfinder.com bugmenot -- Bypass compulsory web registration with bugmenot.com bugzilla -- Search for bugs on Bugzilla bugtrackers cablesearch -- search for leaked diplomatic communications cia -- Search CIA documents at www.cia.gov cisco -- Search Cisco documentation (www.cisco.com) cite -- Search computer science papers (citeseerx.ist.psu.edu) cliki -- Search the common lisp wiki cnn -- Search on CNN (cnn.com) codesearch -- Search source code using Google Code Search (www.google.fr/codesearch) comlaw -- Search Australian Law using Comlaw (www.comlaw.gov.au) ctan -- Search the Comprehensive TeX Archive Network (ctan.org) currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) cve -- Search for CAN assignments in CVE debbugs -- Search the debian BTS (bugs.debian.org) debcodesearch -- Search debian source code debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) deblists -- Search debian mailing lists (lists.debian.org/search.html) deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net) debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) debpkghome -- Visit the home page for a Debian package debpts -- Search the Debian Package Tracking System (packages.qa.debian.org) debsec -- Search the Debian Security Tracker for CVE ids or package names debvcsbrowse -- Browse the VCS repository for a Debian package debwiki -- Search the Debian Wikis (wiki.debian.org & women.debian.org/wiki) deja -- Search usenet using Google Groups (groups.google.com) deli -- Search Delicious bookmarks discogs -- Search the Discogs database of music information (www.discogs.com) dmoz -- Search the Open Directory Project web directory (dmoz.org) duckduckgo -- Securely search the web using duckduckgo (www.duckduckgo.com) ebay -- Search the Ebay auction site etym -- Look up word origins at www.etymonline.com excite -- Search on Excite (www.excite.com) f5 -- Search F5 related information (www.f5.com) finkpkg -- Search Fink packages (pdb.finkproject.org) foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org) freebsd -- Search FreeBSD related information (www.freebsd.org) freedb -- Search for cd track listings in FreeDB (www.freedb.org) freshmeat -- Search Freshmeat (www.freshmeat.net) fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org) gcache -- Search the web using Google cache (www.google.com) genbugs -- Search the Gentoo bug tracker (bugs.gentoo.org) genportage -- Search gentoo-portage.com for packages github -- Search GitHub (https://github.com) google -- Search the web using Google (www.google.com) gutenberg -- Search for books on Project Gutenberg (gutenberg.org) imdb -- Search the Internet Movie Database (www.imdb.com) ixquick -- Search the web using ixquick [HTTPS] (www.ixquick.com) jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) javasun -- Search Java API docs (java.sun.com) jquery -- Search the jQuery documentation (api.jquery.com) l1sp -- Search lisp documentation lastfm -- Search last.fm leodict -- Search Leo's German <-> English dictionary (dict.leo.org) lsm -- Search the Linux Software Map macports -- Search macports packages (macports.org) mathworld -- Search Wolfram MathWorld mdn -- Search the mozilla developer network (developer.mozilla.org) mininova -- Search the mininova bittorent source. musicbrainz -- Search MusicBrainz (musicbrainz.org) mysqldoc -- Search mysql documentation (dev.mysql.com) netbsd -- Search NetBSD related information (www.netbsd.org) ntrs -- Search the NASA Technical Report Server openbsd -- Search OpenBSD related information (www.openbsd.org) openports -- search openports for OpenBSD packages opensearch -- Search an OpenSearch-enabled website oraclesearch -- Search an OpenSearch-enabled website pasearch -- Search the unofficial Penny Arcade archives (pipefour.org/pa) pgdoc -- Search postgres documentation (www.pgdoc.com) pgpkeys -- Search the PGP key database phpdoc -- Search php documentation (php.net) pin -- Search Pinboard bookmarks (http://pinboard.in) piratebay -- Search The Pirate Bay (http://thepiratebay.org) priberam -- Look up word in Priberam online dictionary (www.priberam.pt/dlpo) pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov) rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) rfc -- Search RFCs (internet standards documents) rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com) rpmsearch -- Search for RPMs in various distros scholar -- Search Google Scholar (scholar.google.com) scicom -- Search Scientific Commons scirus -- Search for science using Scirus (scirus.com) scitopia -- Search for science with scitopia.org scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org) slashdot -- Search stories on Slashdot (www.slashdot.org) slinuxdoc -- Search entries in LDP (www.linuxdoc.org) sourceforge -- Search SourceForge (www.sourceforge.net) springer -- Search Springer for Books and Articles stack -- Search Stack Overflow stockquote -- Get a single stock quote (multiple providers) thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com) translate -- Translate human languages urban -- Search urbandictionary.com for a definition w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) w3html -- Validate a web page URL with the w3c validator (validator.w3.org) w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org) webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com) wetandwild -- Real time weather information (many sources) wikipedia -- Search the free encyclopedia wikipedia woffle -- Search the web using Woffle (localhost:8080) wolfram -- Ask questions of the computational knowledge engine worldwidescience -- Search for science with www.worldwidescience.org +yacy -- Search YaCy P2P search, including ScienceNet yahoo -- Search Yahoo categories (www.yahoo.com) yandex -- Search the web using Yandex (yandex.ru) youtube -- Search YouTube (www.youtube.com) yubnub -- Use the social command-line for the web (yubnub.org) All elvi have useful low calorie help, for example: Usage: rhyme [options] [search words]... Description: Surfraw search for rhymes and other word correlations using Lycos Rhyme (rhyme.lycos.com) Example: $ rhyme Julian $ rhyme -method=rel surfer Results: Hurclean St. Julien. surfboarder, bather, natator, swimmer Local options: -method= Type of word correlation to search for prefect | Perfect rhyme syn | Synonyms hom | Homophones cons | Consonsant rhymes only rel | Semantically related words sub | Phrases spell | Similar spellings pic | Pictures shake | Match with Shakespeare archives def Find wordnet definition Default: perfect Environment: SURFRAW_rhyme_method Global options: -browser=EXECUTABLE Set browser Default: sensible-browser -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: yes Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: yes Environment: SURFRAW_graphical -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: no Environment: SURFRAW_new_window -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: no Environment: SURFRAW_quote_args -version Display Surfraw version (2.2.7) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study If you just want to see the elvi-specific help, use elvi -lh or -local-help. The system wide configuration file can usually be found in /etc/xdg/surfraw/conf (but see 'Config files' above). This can be overridden by setting the environment variable SURFRAW_global_conf. Each user can also specify their own overrides, usually in $HOME/.config/surfraw/conf (again, see 'Config files' above). This can be overridden by setting SURFRAW_conf, either in the environment or the global config file. e.g SURFRAW_graphical_remote=yes SURFRAW_graphical_browser=mozilla SURFRAW_text_browser=w3m SURFRAW_pgpkeys_sigs=on INTEGRATION There is a browser plugin for Pentadactyl (a vimperator fork) at http://code.google.com/p/dactyl/issues/detail?id=320 For details, see: http://lists.alioth.debian.org/pipermail/surfraw-devel/2011-April/000916.html Code to integrate with uzbl is in examples/uzbl_load_url_from_surfraw RADICALIZATION Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on [email protected] _________________________________________________________________ README originally by Julian Assange Updated by Ian Beckwith _________________________________________________________________ See NEWS, and ChangeLog for a summary of changes. _________________________________________________________________ diff --git a/elvi/Makefile.am b/elvi/Makefile.am index adae4b5..e6d2a27 100644 --- a/elvi/Makefile.am +++ b/elvi/Makefile.am @@ -1,129 +1,130 @@ # $Id$ elvidir=$(ELVIDIR) dist_elvi_SCRIPTS = \ S \ W \ acronym \ ads \ alioth \ amazon \ archpkg \ archwiki \ arxiv \ ask \ aur \ austlii \ bing \ bbcnews \ bookfinder \ bugmenot \ bugzilla \ cablesearch \ cia \ cisco \ cite \ cliki \ cnn \ codesearch \ comlaw \ ctan \ currency \ cve \ debbugs \ debcodesearch \ debcontents \ deblists \ deblogs \ debpackages \ debpkghome \ debpts \ debsec \ debvcsbrowse \ debwiki \ deja \ deli \ discogs \ dmoz \ duckduckgo \ ebay \ etym \ excite \ f5 \ foldoc \ finkpkg \ freebsd \ freedb \ freshmeat \ fsfdir \ gcache \ genbugs \ genportage \ github \ gutenberg \ google \ imdb \ ixquick \ jamendo \ javasun \ jquery \ l1sp \ lastfm \ leodict \ lsm \ macports \ mathworld \ mdn \ mininova \ musicbrainz \ mysqldoc \ netbsd \ ntrs \ openbsd \ openports \ opensearch \ oraclesearch \ pasearch \ pgdoc \ pgpkeys \ phpdoc \ pin \ piratebay \ priberam \ pubmed \ rae \ rfc \ rhyme \ rpmsearch \ scholar \ scicom \ scitopia \ scirus \ scpan \ slashdot \ slinuxdoc \ sourceforge \ springer \ stack \ stockquote \ thesaurus \ translate \ urban \ w3css \ w3html \ w3link \ w3rdf \ wayback \ webster \ wetandwild \ wikipedia \ woffle \ wolfram \ worldwidescience \ + yacy \ yahoo \ yandex \ youtube \ yubnub uninstall-local: -rmdir $(DESTDIR)$(PREFIX)/$(ELVIDIR) diff --git a/elvi/phpdoc b/elvi/phpdoc index a21eba8..fc46e87 100644 --- a/elvi/phpdoc +++ b/elvi/phpdoc @@ -1,129 +1,129 @@ #!/bin/sh -# elvis: phpdoc -- Search PHP documentation (php.net) +# elvis: phpdoc -- Search PHP documentation (php.net) # Author: http://jonyamo.net . surfraw || exit 1 w3_config_hook () { def SURFRAW_php_language "$SURFRAW_lang" def SURFRAW_php_search "functions" } w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search-string] Description: Surfraw search PHP documentation (php.net) Local options: -l, -language= Two letter language code (resembles ISO country codes) en | English (default) pt | Brazilian Portuguese zh | Chinese (Simplified) fr | French de | German ja | Japanese pl | Polish ro | Romanian fa | Persian es | Spanish tr | Turkish Environment: SURFRAW_php_language, SURFRAW_lang Default: en -s, -search= Specialized search on topic all | All php.net sites functions | Function search manual | Online documentation bugs | Bug database news | News archive changelogs | Changelogs pear | Just pear.php.net pecl | Just pecl.php.net talks | Just talks.php.net maillist | General mailing list devlist | Developer mailing list phpdoc | Documentation mailing list Environment: SURFRAW_php_search Default: functions -a, -all alias of -search=all -f, -functions alias of -search=functions -m, -manual alias of -search=manual -b, -bugs alias of -search=bugs -n, -news alias of -search=news -c, -changelogs alias of -search=changelogs -t, -talks alias of -search=talks -maillist alias of -search=maillist -devlist alias of -search=devlist -phpdoc alias of -search=phpdoc EOF w3_global_usage } w3_parse_option_hook () { opt="$1" optarg="$2" case "$opt" in -language=*) setopt SURFRAW_php_language "$optarg" ;; -l=*) setopt SURFRAW_php_language "$optarg" ;; -search=*) setopt SURFRAW_php_search "$optarg" ;; -s=*) setopt SURFRAW_php_search "$optarg" ;; -a|-all) setopt SURFRAW_php_search "all" ;; -f|-functions) setopt SURFRAW_php_search "functions" ;; -m|-manual) setopt SURFRAW_php_search "manual" ;; -b|-bugs) setopt SURFRAW_php_search "bugs" ;; -n|-news) setopt SURFRAW_php_search "news" ;; -c|-changelogs) setopt SURFRAW_php_search "changelogs" ;; -t|-talks) setopt SURFRAW_php_search "talks" ;; -maillist) setopt SURFRAW_php_search "maillist" ;; -devlist) setopt SURFRAW_php_search "devlist" ;; -phpdoc) setopt SURFRAW_php_search "phpdoc" ;; *) return 1 ;; esac return 0 } w3_config w3_parse_args "$@" # w3_args now contains a list of arguments url="http://php.net/" case "$SURFRAW_php_language" in en) lang="en" ;; pt) lang="pt_BR" ;; zh) lang="zh" ;; fr) lang="fr" ;; de) lang="de" ;; ja) lang="ja" ;; pl) lang="pl" ;; ro) lang="ro" ;; fa) lang="fa" ;; es) lang="es" ;; tr) lang="tr" ;; *) lang="en" ;; esac case "$SURFRAW_php_search" in all) search="all" ;; functions) search="quickref" ;; manual) search="manual" ;; bugs) search="bugdb" ;; news) search="news_archive" ;; changelogs) search="changelogs" ;; pear) search="pear" ;; pecl) search="pecl" ;; talks) search="talks" ;; maillist) search="maillist" ;; devlist) search="devlist" ;; phpdoc) search="phpdoc" ;; *) search="functions" ;; esac if [ -n "$w3_args" ]; then escaped_args=$(w3_url_of_arg $w3_args) url="${url}search.php?lang=${lang}&show=${search}&pattern=${escaped_args}" fi w3_browse_url "$url" diff --git a/elvi/yacy b/elvi/yacy new file mode 100755 index 0000000..598bb1f --- /dev/null +++ b/elvi/yacy @@ -0,0 +1,73 @@ +#!/bin/sh +# elvis: yacy -- Search YaCy P2P search, including ScienceNet +. surfraw || exit 1 + +w3_config_hook () { + def SURFRAW_yacy_results "$SURFRAW_results" + def SURFRAW_yacy_site search.yacy.net + defyn SURFRAW_yacy_image no + defyn SURFRAW_yacy_indexonly no +} + +w3_usage_hook () { + cat <<EOF +Usage: $w3_argv0 [options] [search words]... +Description: + Surfraw search YaCy P2P search, including ScienceNet +Local options: + -i, -images Image Search + -I, -indexonly Constrain search to index pages + -S search ScienceNet (sciencenet.kit.edu) + -s=SITE, --site=SITE Search SITE + Default: $SURFRAW_yacy_site + Environment: SURFRAW_yacy_site + -results=NUM Number of search results returned + Default: $SURFRAW_yacy_results + Environment: SURFRAW_yacy_results +EOF + w3_global_usage +} + +w3_parse_option_hook () { + opt="$1" + optarg="$2" + case "$opt" in + -i|-ima*) setoptyn SURFRAW_yacy_image yes ;; + -I|-ind*) setoptyn SURFRAW_yacy_indexonly yes ;; + -S) setopt SURFRAW_yacy_site sciencenet.kit.edu ;; + -s=*) setopt SURFRAW_yacy_site "$optarg" ;; + -r*=*) setopt SURFRAW_yacy_results "$optarg" ;; + *) return 1 ;; + esac + return 0 +} + +w3_config +w3_parse_args "$@" + +url="http://${SURFRAW_yacy_site}/" + +if test -z "$w3_args" ; then + w3_browse_url "$url" +else + escaped_args=$(w3_url_of_arg $w3_args) + url="${url}yacysearch.html?query=${escaped_args}&maximumRecords=${SURFRAW_yacy_results}" + + searchtype=text + if ifyes SURFRAW_yacy_image + then + searchtype=image + fi + url="${url}&contentdom=${searchtype}" + + if ifyes SURFRAW_yacy_indexonly + then + url="${url}&indexof=on" + fi + + url="${url}&Enter=Suchen&verify=ifexist&contentdom=text&nav=filetype%2Cprotocol%2Chosts%2Cnamespace%2Ctopics&startRecord=0&indexof=off&meanCount=5&resource=global&prefermaskfilter=" + + w3_browse_url "$url" +fi + + diff --git a/links.IN b/links.IN index ea1df67..99c3530 100644 --- a/links.IN +++ b/links.IN @@ -1,119 +1,120 @@ elvi.1sr.gz @mandir@/man1/W.1.gz elvi.1sr.gz @mandir@/man1/S.1sr.gz elvi.1sr.gz @mandir@/man1/acronym.1sr.gz elvi.1sr.gz @mandir@/man1/ads.1sr.gz elvi.1sr.gz @mandir@/man1/alioth.1sr.gz elvi.1sr.gz @mandir@/man1/amazon.1sr.gz elvi.1sr.gz @mandir@/man1/archpkg.1sr.gz elvi.1sr.gz @mandir@/man1/archwiki.1sr.gz elvi.1sr.gz @mandir@/man1/arxiv.1sr.gz elvi.1sr.gz @mandir@/man1/ask.1sr.gz elvi.1sr.gz @mandir@/man1/aur.1sr.gz elvi.1sr.gz @mandir@/man1/austlii.1sr.gz elvi.1sr.gz @mandir@/man1/bing.1sr.gz elvi.1sr.gz @mandir@/man1/bbcnews.1sr.gz elvi.1sr.gz @mandir@/man1/bookfinder.1sr.gz elvi.1sr.gz @mandir@/man1/bugmenot.1sr.gz elvi.1sr.gz @mandir@/man1/bugzilla.1sr.gz elvi.1sr.gz @mandir@/man1/cablesearch.1sr.gz elvi.1sr.gz @mandir@/man1/cite.1sr.gz elvi.1sr.gz @mandir@/man1/cia.1sr.gz elvi.1sr.gz @mandir@/man1/cliki.1sr.gz elvi.1sr.gz @mandir@/man1/cnn.1sr.gz elvi.1sr.gz @mandir@/man1/codesearch.1sr.gz elvi.1sr.gz @mandir@/man1/comlaw.1sr.gz elvi.1sr.gz @mandir@/man1/ctan.1sr.gz elvi.1sr.gz @mandir@/man1/currency.1sr.gz elvi.1sr.gz @mandir@/man1/cve.1sr.gz elvi.1sr.gz @mandir@/man1/debbugs.1sr.gz elvi.1sr.gz @mandir@/man1/debcodesearch.1sr.gz elvi.1sr.gz @mandir@/man1/debcontents.1sr.gz elvi.1sr.gz @mandir@/man1/deblists.1sr.gz elvi.1sr.gz @mandir@/man1/deblogs.1sr.gz elvi.1sr.gz @mandir@/man1/debpackages.1sr.gz elvi.1sr.gz @mandir@/man1/debpkghome.1sr.gz elvi.1sr.gz @mandir@/man1/debpts.1sr.gz elvi.1sr.gz @mandir@/man1/debsec.1sr.gz elvi.1sr.gz @mandir@/man1/debvcsbrowse.1sr.gz elvi.1sr.gz @mandir@/man1/debwiki.1sr.gz elvi.1sr.gz @mandir@/man1/deja.1sr.gz elvi.1sr.gz @mandir@/man1/deli.1sr.gz elvi.1sr.gz @mandir@/man1/discogs.1sr.gz elvi.1sr.gz @mandir@/man1/dmoz.1sr.gz elvi.1sr.gz @mandir@/man1/duckduckgo.1sr.gz elvi.1sr.gz @mandir@/man1/ebay.1sr.gz elvi.1sr.gz @mandir@/man1/etym.1sr.gz elvi.1sr.gz @mandir@/man1/excite.1sr.gz elvi.1sr.gz @mandir@/man1/finkpkg.1sr.gz elvi.1sr.gz @mandir@/man1/foldoc.1sr.gz elvi.1sr.gz @mandir@/man1/freebsd.1sr.gz elvi.1sr.gz @mandir@/man1/freedb.1sr.gz elvi.1sr.gz @mandir@/man1/freshmeat.1sr.gz elvi.1sr.gz @mandir@/man1/fsfdir.1sr.gz elvi.1sr.gz @mandir@/man1/gcache.1sr.gz elvi.1sr.gz @mandir@/man1/genbugs.1sr.gz elvi.1sr.gz @mandir@/man1/genportage.1sr.gz elvi.1sr.gz @mandir@/man1/github.1sr.gz elvi.1sr.gz @mandir@/man1/google.1sr.gz elvi.1sr.gz @mandir@/man1/gutenberg.1sr.gz elvi.1sr.gz @mandir@/man1/imdb.1sr.gz elvi.1sr.gz @mandir@/man1/ixquick.1sr.gz elvi.1sr.gz @mandir@/man1/jamendo.1sr.gz elvi.1sr.gz @mandir@/man1/javasun.1sr.gz elvi.1sr.gz @mandir@/man1/lastfm.1sr.gz elvi.1sr.gz @mandir@/man1/leodict.1sr.gz elvi.1sr.gz @mandir@/man1/l1sp.1sr.gz elvi.1sr.gz @mandir@/man1/lsm.1sr.gz elvi.1sr.gz @mandir@/man1/macports.1sr.gz elvi.1sr.gz @mandir@/man1/mathworld.1sr.gz elvi.1sr.gz @mandir@/man1/mdn.1sr.gz elvi.1sr.gz @mandir@/man1/mininova.1sr.gz elvi.1sr.gz @mandir@/man1/musicbrainz.1sr.gz elvi.1sr.gz @mandir@/man1/mysqldoc.1sr.gz elvi.1sr.gz @mandir@/man1/netbsd.1sr.gz elvi.1sr.gz @mandir@/man1/ntrs.1sr.gz elvi.1sr.gz @mandir@/man1/openbsd.1sr.gz elvi.1sr.gz @mandir@/man1/openports.1sr.gz elvi.1sr.gz @mandir@/man1/opensearch.1sr.gz elvi.1sr.gz @mandir@/man1/oraclesearch.1sr.gz elvi.1sr.gz @mandir@/man1/pasearch.1sr.gz elvi.1sr.gz @mandir@/man1/pgdoc.1sr.gz elvi.1sr.gz @mandir@/man1/pgpkeys.1sr.gz elvi.1sr.gz @mandir@/man1/phpdoc.1sr.gz elvi.1sr.gz @mandir@/man1/pin.1sr.gz elvi.1sr.gz @mandir@/man1/piratebay.1sr.gz elvi.1sr.gz @mandir@/man1/priberam.1sr.gz elvi.1sr.gz @mandir@/man1/pubmed.1sr.gz elvi.1sr.gz @mandir@/man1/rae.1sr.gz elvi.1sr.gz @mandir@/man1/rfc.1sr.gz elvi.1sr.gz @mandir@/man1/rhyme.1sr.gz elvi.1sr.gz @mandir@/man1/rpmsearch.1sr.gz elvi.1sr.gz @mandir@/man1/scholar.1sr.gz elvi.1sr.gz @mandir@/man1/scicom.1sr.gz elvi.1sr.gz @mandir@/man1/scitopia.1sr.gz elvi.1sr.gz @mandir@/man1/scirus.1sr.gz elvi.1sr.gz @mandir@/man1/scpan.1sr.gz elvi.1sr.gz @mandir@/man1/slashdot.1sr.gz elvi.1sr.gz @mandir@/man1/slinuxdoc.1sr.gz elvi.1sr.gz @mandir@/man1/sourceforge.1sr.gz elvi.1sr.gz @mandir@/man1/springer.1sr.gz elvi.1sr.gz @mandir@/man1/stack.1sr.gz elvi.1sr.gz @mandir@/man1/stockquote.1sr.gz elvi.1sr.gz @mandir@/man1/thesaurus.1sr.gz elvi.1sr.gz @mandir@/man1/translate.1sr.gz elvi.1sr.gz @mandir@/man1/urban.1sr.gz elvi.1sr.gz @mandir@/man1/w3css.1sr.gz elvi.1sr.gz @mandir@/man1/w3html.1sr.gz elvi.1sr.gz @mandir@/man1/w3link.1sr.gz elvi.1sr.gz @mandir@/man1/w3rdf.1sr.gz elvi.1sr.gz @mandir@/man1/wayback.1sr.gz elvi.1sr.gz @mandir@/man1/webster.1sr.gz elvi.1sr.gz @mandir@/man1/wetandwild.1sr.gz elvi.1sr.gz @mandir@/man1/wikipedia.1sr.gz elvi.1sr.gz @mandir@/man1/woffle.1sr.gz elvi.1sr.gz @mandir@/man1/wolfram.1sr.gz elvi.1sr.gz @mandir@/man1/worldwidescience.1sr.gz +elvi.1sr.gz @mandir@/man1/yacy.1sr.gz elvi.1sr.gz @mandir@/man1/yahoo.1sr.gz elvi.1sr.gz @mandir@/man1/yandex.1sr.gz elvi.1sr.gz @mandir@/man1/youtube.1sr.gz elvi.1sr.gz @mandir@/man1/yubnub.1sr.gz diff --git a/test/yacy.test b/test/yacy.test new file mode 100644 index 0000000..08d6451 --- /dev/null +++ b/test/yacy.test @@ -0,0 +1,4 @@ +yacy yacy +by the people, for the people +yacy -S CERN +European Organization for Nuclear Research
JNRowe/surfraw
48101bfc4430d4f758ebd79b3c6c0a277b642229
harmonise skip messages
diff --git a/test/cnn.test b/test/cnn.test index fe4cec2..76262b7 100644 --- a/test/cnn.test +++ b/test/cnn.test @@ -1,2 +1,2 @@ -SKIP Needs javascript <sigh> +SKIP needs javascript diff --git a/test/codesearch.test b/test/codesearch.test index 8953ee6..97bc447 100644 --- a/test/codesearch.test +++ b/test/codesearch.test @@ -1 +1 @@ -SKIP Needs javascript +SKIP needs javascript diff --git a/test/deli.test b/test/deli.test index c82734c..1c09ea8 100644 --- a/test/deli.test +++ b/test/deli.test @@ -1 +1 @@ -SKIP: javascript +SKIP: needs javascript diff --git a/test/jamendo.test b/test/jamendo.test index 0698a36..97bc447 100644 --- a/test/jamendo.test +++ b/test/jamendo.test @@ -1 +1 @@ -SKIP javascript +SKIP needs javascript diff --git a/test/scicom.test b/test/scicom.test index 8953ee6..97bc447 100644 --- a/test/scicom.test +++ b/test/scicom.test @@ -1 +1 @@ -SKIP Needs javascript +SKIP needs javascript diff --git a/test/scitopia.test b/test/scitopia.test index 8953ee6..97bc447 100644 --- a/test/scitopia.test +++ b/test/scitopia.test @@ -1 +1 @@ -SKIP Needs javascript +SKIP needs javascript diff --git a/test/worldwidescience.test b/test/worldwidescience.test index 8953ee6..97bc447 100644 --- a/test/worldwidescience.test +++ b/test/worldwidescience.test @@ -1 +1 @@ -SKIP Needs javascript +SKIP needs javascript
JNRowe/surfraw
dae3beca323b3d45066104d1fc0430f5a3d4eed9
fix rae
diff --git a/ChangeLog b/ChangeLog index 7056d1a..58eebca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,517 @@ +2013-10-20 Ian Beckwith <[email protected]> + + * rae: fix url, remove -tipo option (no longer supported), + disable test as there is now gratuitous javascript. + 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. * netbsd: new option -ps to search ports * openbsd: new option -ps to search ports * URLs for *bsd portsearch, finkpkg, macports and rpmsearch from whohas(1), http://www.philippwesche.org/200811/whohas/intro.html * cia, pubmed: fixed tests. 2009-11-12 Ian Beckwith <[email protected]> * New elvi: + finkpkg: search Fink packages. + macports: search macports packages. diff --git a/elvi/rae b/elvi/rae index d6caf2b..08d089d 100755 --- a/elvi/rae +++ b/elvi/rae @@ -1,46 +1,26 @@ #!/bin/sh # $Id$ # elvis: rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) # Author: Ruben Pollan <[email protected]> . surfraw || exit 1 -w3_config_hook () { -def SURFRAW_rae_tipo 0 -} w3_usage_hook () { cat <<EOF Usage: $w3_argv0 [options] [search words]... Description: Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) -Local options: - -tipo= Tipo de busqueda - 0 | Busqueda exacta - 1 | Busqueda sin signos diacriticos - 2 | Semejanza fonetico-ortografica - 3 | Busqueda escalonada - Default: $SURFRAW_rae_tipo - Environment: SURFRAW_rae_tipo EOF w3_global_usage } -w3_parse_option_hook () { - opt="$1" - optarg="$2" - case "$opt" in - -tipo=*) setopt SURFRAW_rae_tipo $optarg ;; - *) return 1 ;; - esac - return 0 -} - w3_config + w3_parse_args "$@" # w3_args now contains a list of arguments if null "$w3_args"; then - w3_browse_url "http://www.rae.es/drae/" + w3_browse_url "http://lema.rae.es/drae/" else escaped_args=`w3_url_of_arg $w3_args` - w3_browse_url "http://www.rae.es/drae/srv/search?type=${SURFRAW_rae_tipo}=&val=${escaped_args}" + w3_browse_url "http://lema.rae.es/drae/?val=${escaped_args}" fi diff --git a/test/rae.test b/test/rae.test index 629c4d9..97bc447 100644 --- a/test/rae.test +++ b/test/rae.test @@ -1,2 +1 @@ -rae palabra -Segmento del discurso unificado habitualmente por el acento +SKIP needs javascript
JNRowe/surfraw
1f0fa90cd7aa577114d60ec649e2755a4788c1f5
tweak NEWS
diff --git a/NEWS b/NEWS index ca1c71a..c1e1463 100644 --- a/NEWS +++ b/NEWS @@ -1,484 +1,483 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc - + To select on the commandline use -custom-search=google or-custom-search=duckduckgo + + To select on the commandline use -custom-search=google or -custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Debian packaging now included in release, in debian/ dir. * Known problems - + ntrs - site (temporarily?) down due to US being weird: - http://blogs.fas.org/secrecy/2013/03/ntrs_dark/ + fink - down temporarily + + deblogs - down (hopefully) temporarily Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$
JNRowe/surfraw
e76118ad90e1604577a4250632754ec751458bab
NEWS: note about fink being down temporarily
diff --git a/NEWS b/NEWS index e6a33c6..ca1c71a 100644 --- a/NEWS +++ b/NEWS @@ -1,483 +1,484 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or-custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Debian packaging now included in release, in debian/ dir. * Known problems + ntrs - site (temporarily?) down due to US being weird: http://blogs.fas.org/secrecy/2013/03/ntrs_dark/ + + fink - down temporarily Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$
JNRowe/surfraw
69e1330d84064dd231cd3cd562b1e30b2a67b8ff
Debian packaging now included in release
diff --git a/ChangeLog b/ChangeLog index 09ce89f..7056d1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,518 +1,519 @@ 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! * S: add test. + * Include debian packaging in upstream tarball. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. * netbsd: new option -ps to search ports * openbsd: new option -ps to search ports * URLs for *bsd portsearch, finkpkg, macports and rpmsearch from whohas(1), http://www.philippwesche.org/200811/whohas/intro.html * cia, pubmed: fixed tests. 2009-11-12 Ian Beckwith <[email protected]> * New elvi: + finkpkg: search Fink packages. + macports: search macports packages. + rpmsearch: search for packages in rpm-based distros. * surfraw.IN: w3_parse_args: avoid bogus initial space in w3_args 2009-11-11 Ian Beckwith <[email protected]> * New elvi: debpkghome: view home page of a debian package. diff --git a/Makefile.am b/Makefile.am index 6793e9e..e0a3e22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,123 +1,128 @@ SUBDIRS = elvi test examples bin_SCRIPTS = surfraw surfraw-update-path if OPENSEARCH dist_bin_SCRIPTS = opensearch-discover opensearch-genquery endif devel_extra = banner prebuild noinst_DATA = surfraw-bash-completion surfraw.bookmarks man_MANS = surfraw-update-path.1 surfraw.1 elvi.1sr if OPENSEARCH man_MANS += opensearch-discover.1 opensearch-genquery.1 endif + +debian_extra = debian/NEWS debian/README.Debian debian/changelog debian/compat debian/control \ + debian/copyright debian/docs debian/postrm debian/rules debian/source/format \ + debian/surfraw-extra.files debian/surfraw-extra.install debian/watch + EXTRA_DIST = surfraw.lsm.in surfraw.IN surfraw-update-path.IN\ surfraw.spec.in aclocal.m4 HACKING \ surfraw.1.IN elvi.1sr.IN surfraw.bookmarks links.IN \ surfraw-bash-completion.IN surfraw.conf.IN \ - $(devel_extra) + $(devel_extra) $(debian_extra) CLEANFILES = surfraw surfraw-update-path surfraw-update-path.1 surfraw.spec surfraw.lsm \ surfraw.1 elvi.1sr links surfraw-bash-completion surfraw.conf surfraw.1 \ elvi.1sr opensearch-discover.1 opensearch-genquery.1 BUILT_SOURCES = surfraw.conf # we cannot portably combine single suffix rules and separated dependencies # so we have to explicitly specify all the .IN rules surfraw: surfraw.IN -rm -f $@ [email protected] sed -e 's,@VERSION\@,${VERSION},g; '\ -e 's,@ELVIDIR\@,${ELVIDIR},g; '\ -e 's,@AWK\@,${AWK},g; '\ -e 's,@sysconfdir\@,${sysconfdir},g ' $? > [email protected] chmod +x [email protected] mv [email protected] $@ surfraw.conf: surfraw.conf.IN -rm -f $@ [email protected] sed -e 's,@prefix\@,${prefix},g; '\ -e 's,@TEXTBROWSER\@,${TEXTBROWSER},g; '\ -e 's,@GRAPHICALBROWSER\@,${GRAPHICALBROWSER},g; ' $? > [email protected] chmod +x [email protected] mv [email protected] $@ surfraw-update-path: surfraw-update-path.IN -rm -f $@ [email protected] sed -e 's,@ELVIDIR\@,${ELVIDIR},g; ' $? > [email protected] chmod +x [email protected] mv [email protected] $@ surfraw-bash-completion: surfraw-bash-completion.IN -rm -f $@ [email protected] sed -e 's,@ELVIDIR\@,${ELVIDIR},g; ' $? > [email protected] chmod +x [email protected] mv [email protected] $@ elvi.1sr: elvi.1sr.IN -rm -f $@ [email protected] sed -e 's,@ELVIDIR\@,${ELVIDIR},g; ' $? > [email protected] chmod +x [email protected] mv [email protected] $@ surfraw.1: surfraw.1.IN -rm -f $@ [email protected] sed -e 's,@ELVIDIR\@,${ELVIDIR},g; '\ -e 's,@sysconfdir\@,${sysconfdir},g' $? > [email protected] chmod +x [email protected] mv [email protected] $@ links: links.IN -rm -f $@ [email protected] sed -e 's,@mandir\@,${mandir},g; ' $? > [email protected] chmod +x [email protected] mv [email protected] $@ surfraw-update-path.1: surfraw-update-path -rm -f $@ pod2man $? > $@ opensearch-discover.1: opensearch-discover -rm -f $@ pod2man $? > $@ opensearch-genquery.1: opensearch-genquery -rm -f $@ pod2man $? > $@ install-data-hook: links chmod -x surfraw.conf elvi.1sr surfraw.1 mkdir -p $(DESTDIR)@sysconfdir@/xdg/surfraw cp surfraw.conf $(DESTDIR)@sysconfdir@/xdg/surfraw/conf cp $(top_srcdir)/surfraw.bookmarks $(DESTDIR)@sysconfdir@/xdg/surfraw/bookmarks while read target link ;\ do \ ln -sf $$target $(DESTDIR)/$$link ;\ done < links if INSTALLSR ln -sf surfraw $(DESTDIR)/@bindir@/sr ln -sf surfraw.1.gz $(DESTDIR)/@mandir@/man1/sr.1.gz endif uninstall-local: links -rm -f $(DESTDIR)@sysconfdir@/xdg/surfraw/conf -rm -f $(DESTDIR)@sysconfdir@/xdg/surfraw/bookmarks rmdir $(DESTDIR)@sysconfdir@/xdg/surfraw 2>/dev/null rmdir $(DESTDIR)@sysconfdir@/xdg 2>/dev/null while read target link ;\ do \ rm -f $(DESTDIR)/$$link ;\ done < links if INSTALLSR rm -f $(DESTDIR)/@bindir@/sr rm -f $(DESTDIR)/@mandir@/man1/sr.1.gz endif submit-lsm: surfraw.lsm mail -s add [email protected] < $? test: all surfraw.conf make -C test test .PHONY: test diff --git a/NEWS b/NEWS index 98aa9ed..e6a33c6 100644 --- a/NEWS +++ b/NEWS @@ -1,482 +1,483 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or-custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. + * Debian packaging now included in release, in debian/ dir. * Known problems + ntrs - site (temporarily?) down due to US being weird: http://blogs.fas.org/secrecy/2013/03/ntrs_dark/ Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$
JNRowe/surfraw
265025de644662e90ee0ec422075207f70abdc55
S: add test
diff --git a/ChangeLog b/ChangeLog index 70d65ba..09ce89f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,517 +1,518 @@ 2013-10-06 Ian Beckwith <[email protected]> * Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]> Thanks, and apologies for missing it! + * S: add test. 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. * netbsd: new option -ps to search ports * openbsd: new option -ps to search ports * URLs for *bsd portsearch, finkpkg, macports and rpmsearch from whohas(1), http://www.philippwesche.org/200811/whohas/intro.html * cia, pubmed: fixed tests. 2009-11-12 Ian Beckwith <[email protected]> * New elvi: + finkpkg: search Fink packages. + macports: search macports packages. + rpmsearch: search for packages in rpm-based distros. * surfraw.IN: w3_parse_args: avoid bogus initial space in w3_args 2009-11-11 Ian Beckwith <[email protected]> * New elvi: debpkghome: view home page of a debian package. diff --git a/test/S.test b/test/S.test new file mode 100644 index 0000000..b7e88b3 --- /dev/null +++ b/test/S.test @@ -0,0 +1,4 @@ +S -custom-search=duckduckgo foo +Urban Dictionary +S -custom-search=google foo +About [\d,]+ results
JNRowe/surfraw
dd8fa68e80d54a78887a80df955d0f730c0ab4b8
Replaced phpdoc with version posted back in 2011 by Jon Yamokoski <[email protected]>. Thanks, and apologies for missing it!
diff --git a/AUTHORS b/AUTHORS index d590362..d59b744 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,163 +1,165 @@ AUTHORS Julian Assange <[email protected]> original author Christian Surchi <[email protected]> original debian maintainer elvi: debcontents, debbugs, debpackages Ian Beckwith <[email protected]> current debian maintainer elvi: alioth, bbcnews, bugzilla, deblists, freedb, imdb, scpan, codesearch, debwiki, lastfm, musicbrainz, opensearch, scholar, ctan, fsfdir, gutenberg, wayback, dmoz, w3html, w3link, w3css, w3rdf, debpts, rfc, lsm, finkpkg, rpmsearch, macports, debpkghome, debvcsbrowse, scroogle, scirus, scitopia, worldwidescience, debcodesearch, jquery, mdn, mysqldoc, pgdoc, - phpdoc, oraclesearch, S + oraclesearch, S plus various tweaks/bugfixes/features. Moritz Muehlenhoff <[email protected]> elvi: debsec, ebay, leodict, wikipedia, sharereactor, pgpkeys, happypenguin plus various patches/maintenance. Thomas Smith <[email protected]> Bugfixes, uploading. Stephen Stafford <[email protected]> Bug fixes Kevin Kreamer <[email protected]> Bug fixes Christian Weisgerber <[email protected]> elvi: fast, thesaurus, webster Jason Harris <[email protected]> elvi: freebsd, openbsd, filesearching, ftpfind Ruben Pollan <[email protected]> elvi: rae Ian Broadfoot <[email protected]> elvi: yubnub James Rowe <[email protected]> plus useful patches/maintenance. Aparna Jaitly <[email protected]> elvi: ixquick Justin B. Rye <[email protected]> elvi: cia, deblogs, etym, foldoc plus useful patches. Patroklos Argyroudis <[email protected]> elvi: discogs Simon Ernst <[email protected]> elvi: archpkg Ivy Foster <[email protected]> elvi: bookfinder, bugmenot plus various patches/maintenance Sumant Oemrawsingh <[email protected]> elvi: cliki, l1sp, mathworth, mininova, youtube plus patches, including the uzbl examples. Sadako <[email protected]> imdb fixes tczy <[email protected]> elvi: bing Simone Fittabile <[email protected]> elvi: acronym, gcache, jamendo plus patches. Micah Anderson <[email protected]> various patches René Reigel <[email protected]> elvi: aur J.R. Mauro <[email protected]> elvi: urban, piratebay, genportage Wim van Hoydonck <[email protected]> elvi: ntrs, springer, sc John Briggs <[email protected]> patch to google John Gruenenfelder <[email protected]> elvi: arxiv csh patch James TD Smith <[email protected]> elvi: javasun google country-specific options Charles Twardy <[email protected]> fixed cia Uspenskiy Andrey <[email protected]> elvi: yandex Jameson Rollins <[email protected]> elvi: ads plus tweaks. Jakob <[email protected]> elvi: pasearch Kyle Isom <[email protected]> elvi: cablesearch, duckduckgo, openports, wolfram plus various fixes/maintenance. Jason Ryan <[email protected]> elvi: archwiki, deli, github, stack, pin plus various fixes/maintenance Sara Fauzia <[email protected]> archpkg fix. Thomas Zervogiannis <[email protected]> Searchable bookmarks. Paulo Almeida <[email protected]> elvi: priberam Shain Singh <[email protected]> elvi: cisco, f5 Manolo Martínez <[email protected]> examples: elinks integration (hooks.lua) +Jon Yamokoski <[email protected]> + elvi: phpdoc THANKS TO Brian Nelson <[email protected]> Christian Garbs <[email protected]> Hector Blanco <[email protected]> Jeff Bailey <[email protected]> Mark W. Eichin <[email protected]> Teófilo Ruiz Suárez <[email protected]> Maru Dubshinki <[email protected]> Matt Kraai <[email protected]> Brian Mcdonald <[email protected]> Carl Fredrik Hammar <[email protected]> Andy Valencia <[email protected]> Philip Armstrong <[email protected]> Dan Jacobson <[email protected]> Sunil Nimmagadda <[email protected]> Michel <[email protected]> Nikos Apostolakis <[email protected]> Facundo Aguirre <[email protected]> Raphael Geissert <[email protected]> If we've missed anyone, let us know. diff --git a/ChangeLog b/ChangeLog index af4f8c6..70d65ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,512 +1,518 @@ +2013-10-06 Ian Beckwith <[email protected]> + + * Replaced phpdoc with version posted back in + 2011 by Jon Yamokoski <[email protected]> + Thanks, and apologies for missing it! + 2013-10-05 Ian Beckwith <[email protected]> * ask, cisco: fix elvi. * new elvi: + oraclesearch - Replaces removed sunonesearch <sigh>. + S - search using w3_custom_search. * google: -g for groups clashed with -g for graphical browser. Invoke groups with -G, -gr, -groups or -search=groups. * mdn: site invokes google custom search via gratuitous javascript, so switch to w3_custom_search. * alioth: changed test to SKIP:, works OK but won't talk to LWP, hence test breaks. * discogs, openbsd: fixed tests. * mdn, mysqldoc, pgdoc, phpdoc: added tests. * w3_custom_search: + document in README. + remove documentation for ixquick support. It still works(ish), but doesn't support enough features to support (eg) mysqldoc -v=. + add -custom-search= commandline option. * updated copyright years to 2013. 2013-09-30 Ian Beckwith <[email protected]> * new elvi: mdn, mysqldoc, pgdoc, phpdoc * new function: w3_custom_search Is used by elvi that use a generic search engine with (eg) site: or inurl: to narrow down the search. Pass it -s=site -u=url for site: and inurl: args plus the quoted search args * new environment variable: SURFRAW_customsearch_provider to set provider used by w3_custom_search can be set to: google, duckduckgo or ixquick. Currently affects: mysqldoc, netbsd(*), openbsd(*), pgdoc, phpdoc, mysqldoc. (*) = only used by some options of elvi. * new internal variable w3_shquoted_args, contains arguments 'quoted' 'like this' for passing to w3_custom_search * Fixed url-encoding for '\' 2013-05-07 Ian Beckwith <[email protected]> * new elvi: jquery 2013-05-04 Ian Beckwith <[email protected]> * bump version to 2.2.9 * rae: fixed, at least as far as the test passing. Could really do with some love from someone who actually speaks spanish. * ctan: fixed search, updated options. Note command-line options have changed. * genportage: switch to gpo.zugaina.org * debcodesearch: new (trivial) elvi for codesearch.debian.net * jamendo: fix url, disable test (search now javascript) * deli: fix url; remove options; disable test (search now javascript) 2013-04-28 Ian Beckwith <[email protected]> * musicbrainz: fixed mbid search. * springer: fixed test. 2013-04-27 Ian Beckwith <[email protected]> * javasun: fixed test. 2013-04-24 Ian Beckwith <[email protected]> * Rewrote deblists for new xapian search. + -author, -lists, -lang no longer supported. + added -ml and -mv to show message id links and list view. * Removed happypenguin. Currently defunct and they are talking about a rewrite, so when it is back it will need fixing anyway. 2012-10-22 Ian Beckwith <[email protected]> * Fixed elvi: cisco, slashdot, slinuxdoc. * Removed elvi: scroogle (site gone). * Fixed tests: acronym, bbcnews, bugzilla, cisco, cite[1], currency, discogs, excite, fsfdir, gcache, github, imdb, ixquick, lastfm, leodict, openbsd[2], scholar. * test/Makefile.am: Added missing tests to EXTRA_DIST 2012-06-28 Manolo Martínez <[email protected]> * examples/hooks.lua: Added elinks integration script 2012-06-28 Ivy Foster <[email protected]> * Further simplified searchable bookmarks 2012-06-28 Thomas Zervogiannis <[email protected]> * Simplified searchable bookmarks 2012-06-27 Ivy Foster <[email protected]> * Fixed arg parsing in searchable bookmarks * New variable: SURFRAW_bookmark_search_elvis + When using searchable bookmarks, if all else fails run this elvis. Defaults to google * Updated manual to reflect changes to bookmarks * duckduckgo: Removed -p option. -safe still works. + Prevents clobbering global option -p[rint]. 2012-06-27 Thomas Zervogiannis <[email protected]> * Added searchable bookmarks + Bookmarks can now be searchable by adding '%s' to the url string. 2012-06-01 Jason Ryan <[email protected]> * New elvi: github (search github.com) 2012-03-17 Ivy Foster <[email protected]> * Fix a typo in duckduckgo code. 2012-03-17 Ivy Foster <[email protected]> * Keep duckduckgo's -l[ucky] from clobbering -lh 2012-01-10 Ivy Foster <[email protected]> * aur: now uses HTTPS by default + On the AUR, connecting via HTTP disables login. + Added switch -no-https to enable connection via plain HTTP 2011-10-10 Ian Beckwith <[email protected]> * surfraw.IN: test_elvi(): tweak sed regex * add tests for f5, cisco and pin. 2011-10-10 Shain Singh <[email protected]> * New elvi: f5, cisco 2011-10-10 Jason Ryan <[email protected]> * New elvi: pin (search pinboard.in). 2011-09-09 Kyle Isom <[email protected]> * New elvi: wolfram - query Wolfram Alpha * Author: Kyle Isom <[email protected]> * Added test for wolfram. 2011-08-09 Ian Beckwith <[email protected]> * New elvi: priberam - search Portuguese dictionary. Author: Paulo Almeida <[email protected]> * Added test for priberam. 2011-07-11 Ian Beckwith <[email protected]> * netbsd: fix normal & mail search. google custom searches were complaining I was a bot, so I switched to normal google searches with site:{mail-index,}.netbsd.org. * cia: fix search URL 2011-06-17 Ian Beckwith <[email protected]> * arxiv: fix -scope=author with single-word queries. Thanks to Nikos Apostolakis. * btw, note about entry below, netbsd make *does* support '$<', but only in suffix rules. 2011-06-16 Ian Beckwith <[email protected]> * Fix more make(1) portability problems. Either I am horribly confused or netbsd make (or at least pmake in debian) doesn't support '$<'. Switched to '$?'. * Also switched submit-lsm rule to '$?'. Thanks to Kyle Isom. * Removed long-obsolete commented-out sourceforge upload rules. 2011-06-15 Ian Beckwith <[email protected]> * scitopia, worldwidescience: fixed URLs. * Fixed make portability problems. We cannot portably combine single suffix rules (foo.IN->foo) and separated dependencies so we have to explicitly specify all the .IN rules. The solution we used for this until now was specific to GNU make. * Removed Makefile.include, no longer used. * './configure --enable-opensearch' now only controls installation of the (direct) dependencies for opensearch, not opensearch itself, as opensearch now falls back to using a remote reflector if opensearch-discover(1) and opensearch-genquery(1) aren't found. * yandex: fix test. 2011-06-14 Ian Beckwith <[email protected]> * musicbrainz, codesearch, rpmsearch: Fixed URLs, options and tests. The sites have all changed significantly which means both new options and no-longer-supported options. Codesearch has gone all ajaxy, so I've implemented the options via the search string, e.g. adding " package:foo". Disabled codesearch.test, as it now needs javascript. Codesearch on both google.com and google.co.uk was acting up, so I've pointed it at google.fr. * Removed filesearching elvi, it now requires a 'Referer:' header to work. There is no browser-portable way to specify a 'Refer[r]er:' header, plus we should probably take it as a hint. * Tweaked debian packaging. * Updated NEWS. 2011-06-13 Ian Beckwith <[email protected]> * w3link: fixed URLs. 2011-06-10 Ian Beckwith <[email protected]> * Fixed ctan. Option -doc has been replaced by -id. Options are no longer mutually exclusive, you can now do (eg) ctan -d -i -n texlive. 2011-06-09 Ian Beckwith <[email protected]> * fixed tests: debwiki, ntrs, wayback. 2011-06-07 Ian Beckwith <[email protected]> * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". 2011-05-31 Jason Ryan <[email protected]> * Add options to archpkg. 2011-05-12 Sara Fauzia <[email protected]> * Fix archpkg URL. 2011-05-12 Ian Beckwith <[email protected]> * surfraw.IN: + if elvi doesn't exist, send usage to stderr not stdout. + bookmark names: do exact match not substring match. * Added tests for archwiki, deli & stack. * README: + added INTEGRATION section on uzbl and pentadactyl. + upcased section headings for clarity. 2011-05-12 Jason Ryan <[email protected]> * New elvi: + archwiki: search the arch wiki. + deli: search delicious.com. + stack: search stackoverflow.com and friends. 2011-03-21 Ian Beckwith <[email protected]> * google: Added -safe=default|off|moderate|strict option for Safe Search. 2011-03-21 Ivy Foster <[email protected]> * Added Google Translate to elvi/translate. 2011-03-03 Ian Beckwith <[email protected]> * opensearch: new option -r, uses redirector at http://erislabs.net/ianb/webtools/opensearch/ instead of calling opensearch-discover and opensearch-genquery. -r is selected automatically if those tools are not installed. This enables us to ship opensearch in the main surfraw package and it still functions if the dependencies are not installed. See debian/changelog. * wikipedia: new options: + -d, uses a redirector at http://erislabs.net/ianb/webtools/wpdp/ This redirector searches for a page with that name at wikipedia. If not found, it searches deletionpedia, if not found there it falls back to a normal wikipedia search. + -f=w|d, -fallback=wikipedia|deletionpedia Implies -d. If page not found at either wikipedia or deletionpedia, whether to fallback to wikipedia search or deletionpedia search. * google: + support video, maps and news. + new options -i, -v, -m, -n, shortcuts for -search={images,videos,maps,news}. * debcontents, debpackages: update docs for new arches and distributions. * bugzilla: + fix url so it works with redhat & eclipse bugzillas too. + enable -s=redhat. * ixquick, w3css: fix tests. * opensearch, wikipedia: add redirector tests. 2011-02-20 Ian Beckwith <[email protected]> * New elvi: bugzilla - searches various bugzillas, defaults to kernel. * pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. * bump version to 2.2.8. * test/Makefile.am: add cablesearch.test. 2011-02-19 Ian Beckwith <[email protected]> * lastfm: fix url to avoid a redirect that mangled args with spaces. * debbugs: add -s as an alias for -search=src. * surfraw.IN: (finally) update copyright year to 2011. * remove traces of port elvi from build system. 2011-02-09 Kyle Isom <[email protected]> * fix a number of tests to match current site formats 2011-01-12 Kyle Isom <[email protected]> * New elvi: + cablesearch - search wikileaks cables + duckduckgo - replace with better implementation + openports - search openbsd ports 2010-12-04 Jakob <[email protected]> * new elvis: pasearch. 2010-12-08 Ian Beckwith <[email protected]> * arxiv: Thanks to MT <[email protected]> for patch that fixes: 1. Search queries with more than two terms would fail, e.g. 'supermassive black hole'. 2. Full text search was broken, it works now. 3. Enhancement: quoting the query now does an exact string match. 2010-10-29 Ian Beckwith <[email protected]> * wayback: advanced search is broken, rip out all options and use basic search. * w3_url_escape: add /g to '/'->'%2F' replacement. * uzbl_load_url_from_surfraw: use @AWK@ to pick up ./configure's choice of awk implementation. 2010-10-28 Ian Beckwith <[email protected]> * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * google, duckduckgo, opensearch, wayback: tweak overbroad option parsing so it doesn't interfere with -lh. * Support -h as a synonym for -help. 2010-10-25 Ian Beckwith <[email protected]> * new elvi: scirus, scitopia, worldwidescience. * yahoo: reduced query string to just p and n options. * openbsd: support -misc and -tech. Thanks to Sunil Nimmagadda for the patch. * removed cddb: gracenote made the "hard decision" to remove the website search. sigh. * removed altavista: is now just a front-end to yahoo. * removed fast: another yahoo front-end. * imdb: fix test. * javasun: oracleized URLs. * w3link: fixed URL. 2010-08-22 Jameson Rollins <[email protected]> * surfraw.IN: Improve listing of elvi. 2010-08-20 James Rowe <[email protected]> * new elvi: ads. Thanks to Jameson Rollins. 2010-07-02 Ian Beckwith <[email protected]> * new elvi: yandex. Thanks to Uspenskiy Andrey. 2010-05-06 Ian Beckwith <[email protected]> * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. * Fixed tests: deblists google openbsd. 2010-04-28 Ian Beckwith <[email protected]> * configure.in: test for google-chrome, opera and links2. 2010-04-22 Ian Beckwith <[email protected]> * debwiki: remove -w, Debian Women wiki is now being merged into main wiki. Thanks to Simone Fittabile. * debwiki.test: stop testing -w option. * surfraw.IN: change an awk to @AWK@. 2010-04-21 Ian Beckwith <[email protected]> * New elvi: jamendo - Search Jamendo: free music with Creative Commons licenses (www.jamendo.com). Thanks to Simone Fittabile. * wikipedia, ixquick: Support https. Thanks to Simone Fittabile. * wikipedia: tweak Simone's patch to support https for start page and document the SURFRAW_wikipedia_ssl variable. * ixquick: add -nossl option. * javasun.test: revert to previous test, works again. 2010-04-19 James Rowe <[email protected]> * genpkg: removed, use genportage. 2010-04-16 Ian Beckwith <[email protected]> * New elvi: + scroogle: Search Google anonymously via www.scroogle.org. + duckduckgo: Search the web via duckduckgo.com. * Fix tests: excite, javasun, musicbrainz, yahoo. 2010-03-03 James Rowe <[email protected]> * bookfinder: fix ISBN search test. 2010-03-01 Ian Beckwith <[email protected]> * Removed autotools-generated files from git repo use ./prebuild to regenerate. * Lower required automake version to 1.10. * prebuild: try and find a sane set of autotools, then call autoreconf -vi * Add autotools-generated files to .gitignore * Bump version to 2.2.7 * cnn: fix URL. * cnn.test: Disable. Bloody CNN now needs javascript for search, so should be tested manually. * W, yahoo: fix tests. * Remove unused '-quiet' option. * Update AUTHORS. * Add a note to appendix 1 of HACKING about updating AUTHORS. * runtests: explicitly use elvi and config from source tree, now works when surfraw is not installed (but you need to have run make). * test/Makefile.am: fix bookfinder typo, add bing.test. * remove leading 'sr ' from command lines for following tests: acronym aur bing cliki gcache genportage google javasun l1sp lsm mathworld mininova piratebay youtube * HACKING, README, test/README: document autotools and test suite changes. * Makefile.am: add surfraw.conf to BUILT_SOURCES so it is made by 'make'. This may be a misuse of BUILT_SOURCES. 2010-02-22 Ivy Foster <[email protected]> * Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. 2010-02-15 James Rowe <[email protected]> * elvi/imdb: Fixes for upstream search changes. Thanks to Sadako. * New elvi: bookfinder, thanks to Ivy Foster. 2010-02-14 James Rowe <[email protected]> * Added $SURFRAW_screen_args for passing arguments to the defined screen tool, thanks to Ivy Foster. * Support for using tmux as $SURFRAW_screen, thanks once again to Ivy Foster. * New elvi: bugmenot, thanks to Ivy Foster. 2010-02-05 Ian Beckwith <[email protected]> * Added options for 'aur' elvi. Patch from Ivy Foster. 2010-02-02 Ian Beckwith <[email protected]> * New elvi: bing, thanks to tczy. Elvi number One Hundred!!!1! 2010-01-26 James Rowe <[email protected]> * elvi/bbcnews: Fixes for upstreams search changes. Based on a patch by Sumant Oemrawsingh. 2010-01-06 Ian Beckwith <[email protected]> * surfraw.1.IN: document new config locations. 2009-11-20 Ian Beckwith <[email protected]> * test/Makefile.am: Add missing tests to EXTRA_DIST. 2009-11-13 Ian Beckwith <[email protected]> * freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. * netbsd: new option -ps to search ports * openbsd: new option -ps to search ports * URLs for *bsd portsearch, finkpkg, macports and rpmsearch from whohas(1), http://www.philippwesche.org/200811/whohas/intro.html * cia, pubmed: fixed tests. 2009-11-12 Ian Beckwith <[email protected]> * New elvi: + finkpkg: search Fink packages. + macports: search macports packages. + rpmsearch: search for packages in rpm-based distros. * surfraw.IN: w3_parse_args: avoid bogus initial space in w3_args 2009-11-11 Ian Beckwith <[email protected]> * New elvi: debpkghome: view home page of a debian package. 2009-11-10 Ian Beckwith <[email protected]> diff --git a/NEWS b/NEWS index b897e6b..98aa9ed 100644 --- a/NEWS +++ b/NEWS @@ -1,482 +1,482 @@ ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! N E W S Sun Oct 6 02:17:09 BST 2013 - surfraw 2.2.9 * New elvi: + S - search using w3_custom_search (see below) + cisco - search Cisco documentation + debcodesearch - search Debian codebase + github - search github + jquery - search jQuery documentation + mdn - search Mozilla Developer Network + mysqldoc - search MySQL documentation + oraclesearch - search Oracle documentation + pgdoc - search PostgreSQL documentation + phpdoc - search PHP documentation + pin - search pinboard.in + wolfram - search Wolfram Alpha * Changed elvi: + aur - uses HTTPS by default, use -no-https to disable + deblists * Removed options -author, -lists, -lang * added options -ml (message links) and -mv (list view) + duckduckgo: * removed -p (clashes with global print option), use -safe instead * stopped -l[ucky] from clobbering -lh + google: changed -g option to -G to avoid clash with -g for graphical view * Fixed elvi: ask, ctan, deli, genportage, jamendo, javasun, musicbrainz, rae, slashdot, slinuxdoc * Removed elvi for dead sites: happypenguin, scroogle, sunonesearch (replaced by oraclesearch) * w3_custom_search + elvi that use a search engine as a backend with site: and inurl: can now choose which search engine to use. So far, google and duckduckgo are supported, with duckduckgo the default. - + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, phpdoc, slinuxdoc + + Affected elvi: mdn, mysqldoc, netbsd, openbsd, pgdoc, slinuxdoc + To select on the commandline use -custom-search=google or-custom-search=duckduckgo + Or configure SURFRAW_customsearch_provider * New variable: SURFRAW_bookmark_search_elvis When using searchable bookmarks, if all else fails run this elvis. Defaults to google * New example elinks integration script in examples/hooks.lua. * Known problems + ntrs - site (temporarily?) down due to US being weird: http://blogs.fas.org/secrecy/2013/03/ntrs_dark/ Tue Jul 12 00:46:02 BST 2011 - surfraw 2.2.8 * New elvi: + ads - search the SAO/NASA Astrophysics data system. + archwiki: search the arch wiki. + bugzilla - search various bugzillas, defaults to kernel. + cablesearch - search wikileaks cables + deli: search delicious.com. + duckduckgo - replace with better implementation + openports - search openbsd ports + pasearch - search Penny Arcade archives. + scirus, scitopia, worldwidescience - science searches + stack: search stackoverflow.com and friends. + yandex - russian web search. * Changed elvi: + archpkg: now supports options. + arxiv: quote queries for exact string matches. + ctan: Option -doc replaced by -id. Options no longer mutually exclusive. + codesearch, musicbrainz, rpmsearch: rewritten to match new site. Options have changed to match site, see help message. + debbugs: add -s as an alias for -search=src. + google: new options: * -v, -search=video: search video * -m, -search=maps: search maps * -n, -search=news: search news * -i: new shortcut for -search=images * -safe=default|off|moderate|strict: safe search + openbsd: support -misc and -tech. + opensearch: new option -r, uses remote redirector which means it can run without heavy dependencies. + pgpkeys: add more options, support more keyservers, default to sks-keyservers.net. + translate: added Google Translate support. + wayback: advanced search is broken, rip out all options and use basic search. + wikipedia: new option -d, uses remote redirector to search both wikipedia and deletionpedia. use -fallback=wikipedia|deletionpedia to customise behaviour. * Fixed elvi: archpkg, arxiv, cia, codesearch, ctan, javasun, lastfm, musicbrainz, netbsd, rpmsearch, w3link, yahoo. * Removed elvi: + altavista: is now just a front-end to yahoo. RIP. + cddb: gracenote made the "hard decision" to remove the website search. sigh. + fast: another yahoo front-end. + filesearching: refuses to work without 'Referer:' header. + port: site gone * Support -local-help, --local-help or -lh to get elvi-specific help without displaying the global options. This works for all elvi and the main surfraw script. * Support -h as a synonym for -help. * Improved listing of elvi. * Default to surfraw_graphical_remote=no, as chromium doesn't support "-remote openURL". * Bookmark names are now an exact match not a substring match. * Support BSD/POSIX make. * README: added INTEGRATION section on uzbl and pentadactyl. Thu May 6 20:20:09 BST 2010 - surfraw 2.2.7 * New elvi (surfraw now has over one hundred elvi!): + by tczy: * bing: Search using Microsoft's Bing. + by Ivy Foster: * bookfinder: Search for books using www.bookfinder.com. * bugmenot: Bypass compulsory web registration with bugmenot.com. + by Ian Beckwith: * duckduckgo: Search the web via duckduckgo.com. * scroogle: Search Google anonymously via www.scroogle.org. + by Simone Fittabile: * jamendo: Search Jamendo: free music with Creative Commons licenses * Removed elvi: genpkg (use genportage instead). * Fixed elvi: + cnn + imdb (thanks to Sadako) + bbcnews (thanks to Sumant Oemrawsingh and James Rowe) * aur: added options (thanks to Ivy Foster) * wikipedia, ixquick: support https. Thanks to Simone Fittabile. * debwiki: remove -w, Debian Women wiki is being merged into main Debian wiki. Thanks to Simone Fittabile. * Improved support for screen(1). Thanks to Ivy Foster: + Support for using tmux as $SURFRAW_screen. + Added `-ns|-newscreen' switch for setting $SURFRAW_new_screen. + Added $SURFRAW_screen_args for passing arguments to the defined screen tool. * uzbl_load_url_from_surfraw: fix menu. Thanks to Sumant Oemrawsingh. Fri Nov 20 03:34:19 GMT 2009 - surfraw 2.2.6 * New elvi: + by Sumant Oemrawsingh: * cliki - search the common lisp wiki. * l1sp - search lisp documentation. * mathworld - search Wolfram MathWorld. * mininova - search mininova for torrents. * youtube - search youtube for videos. + by Simone Fittabile: * acronym - find acronyms * gcache - search google cache. + by Nick White: * genbugs - search gentoo bug tracker + by Ian Beckwith: * debpkghome - view home page of a debian package. * debvcsbrowse - browse vcs of a debian package * rpmsearch - search for packages in rpm-based distros. * finkpkg - search Fink packages. * macports - search macports packages. * Move config files to follow XDG basedir spec This means that if your global config was in /etc/surfraw.conf it is now in /etc/xdg/surfraw/conf, and local config is now in $HOME/.config/surfraw/conf. The same applies to bookmarks. See README for details on configuring config locations, and http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html for the gory details. The old locations are still supported for backwards-compatibility. * Support per-user elvi in $HOME/.config/surfraw/elvi/ Patch by James Rowe, idea by Sumant Oemrawsingh. * Added -o | -o=FILE option, to fetch URL and dump to stdout or FILE. * Modified elvi: + freebsd: new options -psearch=TYPE -psection=SEC to conduct a search of type TYPE in section SEC of ports. + netbsd: new option -ps to search ports + openbsd: new option -ps to search ports + debsec: fixed (Thanks to Moritz Muehlenhoff, for this and all his other work). + cia: fixed. * Added examples/uzbl_load_url_from_surfraw, to integrate surfraw with uzbl (uzbl.org), thanks to Sumant Oemrawsingh. Wed May 13 02:30:21 BST 2009 - surfraw 2.2.5 * Replaced scaleplus elvi with comlaw. * rfc: use HTML for RFCs and BCPs. * Support '--' to indicate end of options, so, for instance, "sr google -g -- foo -bar" works. * debpackages, debcontents: update ubuntu release names. Sun Mar 1 02:12:14 GMT 2009 - surfraw 2.2.4 * New elvi: + ntrs, scicom, springer - Thanks to Wim Van Hoydonck. + urban - Thanks to J. R. Mauro. + aur - Thanks to René Reigel. * excite: fixed. * cite: changed to use citeseerx.ist.psu.edu, the old citeseer is no longer being updated. * amazon: fixed; updated categories. Sat Sep 13 20:40:01 BST 2008 - surfraw 2.2.3 * Surfraw now defaults to graphical mode. See surfraw(1) for how to change the default back. * Search for default browsers during build. This can be overridden by passing --with-text-browser=BROWSER and --with-graphical-browser=BROWSER to ./configure. * New elvis: piratebay, genportage. Thanks to J.R. Mauro. * Detect which awk to use. * Fixed slinuxdoc and webster. * Removed bashisms. * Fixed uninstall. * Add --disable-sr option to ./configure to disable installing the 'sr' symbolic link, to avoid clashes with the SR programming language. Thu Jul 3 08:47:14 BST 2008 - surfraw 2.2.2 * New elvis: + arxiv - Search the Los Alamos Science E-Print Archive replaces xxx which was just a stub (thanks to John Gruenenfelder). + javasun - search Java API Docs (thanks to James TD Smith) * Fixed elvis: + debpackages/debcontents: update options and distributions, add -a options to use archive.debian.net. + wetandwild: switched to weather.com, as yahoo now uses AJAX. Command line options and SURFRAW_weather_* variables no longer supported. + austlii: fixed search URL, default method is now 'auto'. + port: original site is back. + translate: fixed URLs. * Removed elvis: + sundocs: use sunonesearch. + xxx: replaced by arxiv. * surfraw: fix w3_url_escape quoting (thanks Micah Anderson) * surfraw-update-path: fix csh syntax (thanks John Gruenenfelder) * google: Add -country option to specify country. Respects SURFRAW_lang variable (Thanks to James TD Smith). Sun Mar 9 19:24:26 GMT 2008 - surfraw 2.2.1 * New elvi: + lsm - Search the Linux Software Map. + sunonesearch - Search Sun's One Search (replaces sunsolve). * Fixed elvi: cddb, cnn, debcontents, deblists, debpackages, freedb, fsfdir, genpkg, and yubnub (thanks for the latter to Nathaniel Heinrichs). * Removed elvis: sunsolve (replaced by sunonesearch). * amazon, ebay, translate: expanded language/country list. * Added new configuration variable SURFRAW_lang. Elvi that support specifying language or country will use this as a default. If used, it should be set to an ISO 2-letter country code (eg uk, de, ca). Thanks to Simon Ernst for the idea. * Fixed quoting single quotes in URLs (thanks to Alexander Becher for the patch). Thu Sep 6 21:59:35 BST 2007 - surfraw 2.2.0 * Resumed making upstream releases. Surfraw is now maintained by the Debian Surfraw-Devel Team. Please report bugs to <[email protected]>, and feel free to join us on the list. There have been many changes since the last official release. New elvi: alioth archpkg bbcnews cddb cia codesearch ctan cve deblists deblogs debpts debsec debwiki discogs dmoz ebay etym foldoc freedb fsfdir genpkg gutenberg happypenguin imdb ixquick lastfm leodict musicbrainz opensearch pgpkeys port rae rfc scholar scpan w3css w3html w3link w3rdf wayback wikipedia yubnub Removed elvi: appwatch britannica ftpfind ftpsearch jake raging swhois Elvi now live in /usr/lib/surfraw (or /usr/local/lib/surfraw) Use surfraw-update-path to add this directory to your path or prefix elvi with sr or surfraw, eg "sr google foo bar". Bookmarks can be defined in /etc/surfraw.bookmarks or ~/.surfraw.bookmarks. See /etc/surfraw.bookmarks for the format. Bookmarks can be used with "sr [options] bookmarkname". There is now a test suite. "make test" to run it or see test/README. For a full list of changes since the last release, see debian/changelog. From this release onwards, changes will be logged in ./ChangeLog as normal. Tur Mar 30 01:21:03 CEST 2004 - surfraw 2.0.2 * Added bash completion support by Justin B Rye * Do not set $DISPLAY when running in text mode * Removed sharereactor elvi Tue Feb 10 04:01:40 GMT 2004 - surfraw 2.0.1 Please note that the elvi have moved again, to /usr/lib/surfraw If you used surfraw-update-path from version 2.0 to add the elvi directory to your path, you will need to run it again, first with -remove to remove the old path, then again with -add. To change your path you will need to either log out and in again or source the relevant config files. * Moved elvi to /usr/lib/surfraw * Updated docs for new elvi location * Changed man page section for all elvi to 1sr * Fixed surfraw help text * Added man page links for pgpkeys, ebay and sharereactor * Added linda override (and surfraw.dirs) for usr-lib-in-arch-all * Added debhelper tokens to prerm/postinst (they were in released 2.0-1 but not CVS) * Rewrote man page surfraw.1.in, added man page elvi.1sr.in Both go via autoconf. * Removed old debian/surfraw.1 * Updated debian/surfraw.links to point elvi to elvi.1sr.gz * Updated AUTHORS to hopefully include every contributor, ever. * Changed a few "def"s to "defyn"s in surfraw.conf.in * Fixed quoting so sr google foo "bar baz" qux works * Makefile.am: Added missing files to EXTRA_DIST * Added a debconf note (only visible if upgrading from 2.0-1) explaining the elvi have moved again * configure.in: changed to new AM_INIT_AUTOMAKE format, specified minimum automake version 1.7 * updated surfraw.lsm with new URLs * deleted debian/rules.save (old rules backup) * Removed elvi: + britannica: gone subscription-only + swhois: all whois sites I can find have anti-harvester features that stop us using them. * Fixed elvi: + wikipedia - added missing quotes (could've sworn I did this already) + cnn - updated url + translate - corrected docs * Moved debian/surfraw.links to links.IN in top dir, now uses autoconf and is not debian-specific * Makefile.am: Added install-data-hook to create links * configure.in, elvi/Makefile.in: fixed ELVIDIR quoting * added elvi/surfraw_elvi to CLEANFILES & removed it from cvs, as it is generated on build. * disabled ifs quoting in elvi that don't like it: freedb, happypenguin, jake, rhyme, scaleplus, sharereactor, thesaurus, webster, deblists. * Added note to HACKING explaining how to disable ifs quoting * synced NAMESPACE branch with HEAD Please use the main HEAD branch from now on. * links.IN: made links relative * Converted debconf to po-debconf * Eliminated templates.IN, as it confused po-debconf * Deautoconfiscated the debian directory, as only templates went through autoconf Tue Dec 23 03:19:58 GMT 2003 - surfraw 2.0 New development team, see http://alioth.debian.org/projects/surfraw * Moved elvi to /usr/bin/surfraw-elvi. (Closes: #209155, #192869, #201175) * Provided surfraw-update-path to put new dir in path. * Added sr as alias to surfraw. * Added bookmark support and /etc/surfraw.bookmarks. * New elvi: alioth, rfc, scpan, deblists. (Closes: #134498) plus leodict and happypenguin by Moritz Muehlenhoff (Closes: #217799) and wikipedia, also by Moritz Muehlenhoff (Closes: #223953) and sharereactor, pgpkeys and ebay, also by Moritz Muehlenhoff * Fixed elvi: altavista, debcontents, excite, jake, scaleplus, slinuxdoc, sundocs, swhois, translate. * amazon: fixed test (Closes: #163903) and -country, removed tag-id stuff. * debcontents: changed options to SURFRAW_debcontents_*. * sourceforge: added -type and -exact options. * webster: added -t (thesaurus) option. * debbugs: added options. * Removed elvi: appwatch, ftpsearch, ftpfind, raging (sites defunct). * Updated Debian Standards-Version to 3.6.1.0 * surfraw.in: - Applied Brian Nelson's "-remote openURL" patch (Closes: #165967). - Fixed browser selection (Closes: #118314). * google -l/-lucky support (Closes: #127078, #128544). * Added deja patch from Christian Garbs (Closes: #149600). * debian/rules: changed to use DESTDIR. * Force default browser to sensible-browser (Closes: #119357) - This supercedes NMU changes (Closes: #200164, #201229, #149584) - Change default browser in manpage (Closes: #113148) * Rename stranslate back to translate (Closes: #141243) * Make woffle not look for /usr/local/bin/surfraw (Closes: #156466) * Add lynx to Recommends (Closes: #141242) * Make surfraw lintian-clean - Remove '(s)' from copyright - Remove /etc conffile entries * Kevin Kreamer <[email protected]> did this work. * Easy bugs first - fix type in README (Closes: #154304) - s/README/README.gz/ in manpage (Closes: #164206) * Added elvi for imdb, cddb, freedb and bbcnews written by Ian Beckwith. * changed "Author(s)" to "Author" in debian/copyright * removed debian/conffiles to prevent debhelper being so incredibly "helpful" as to inlude conffiles *twice* Wed Dec 26 02:48:06 EST 2001 - Surfraw 1.0.7 Fix major sed lossage in 1.0.6 which removed all references to http:// (not just in the documentation strings as was intended) Sun Dec 23 21:02:57 EST 2001 - Surfraw 1.0.6 New elvi: freebsd, openbsd, filesearching, ftpfind Updated elvi: translate (babelfish), ftpsearch, fast, netbsd Rename linuxdoc elvi to slinuxdoc, to prevent name clash with sgmltools Use test -r instead of test -e which inexplicably chocked Solaris8 Documentation changes Tue Nov 6 11:14:21 EST 2001 - Surfraw 1.0.5 Fix wayward indentation introduced in 1.0.4 which caused -browser to fail Note that SURFRAW_browser was made obsolete in 1.0.4. SURFRAW_text_browser and SURFRAW_graphical_browser replace its functionality STATE EXTRA CLEARLY THE FORMAT OF ~/.surfraw.conf so even Redhat users get it. Thu Oct 25 05:32:25 EST 2001 - Surfraw 1.0.4 New elvi: debbugs, debcontents, debpackages, swhois, woffle Dead elvi: ircsearch, newscientist -g and -t switch between graphical & text browsers -new opens a new window on -remote comprehending browsers Support "--" option to end all options Fix url space escaping problem Surfraw placed into the public domain Fri Jan 12 14:51:10 EST 2001 - Surfraw 1.0.3 New elvi: amazon Add `scaleplus' elvi to elvi/Makefile.am Minor documentation bug fixes Wed Sep 27 06:37:48 EST 2000 - Surfraw 1.0.2 Viva l`explorateur de texte! http://slashdot.org/articles/00/08/28/1143249.shtml http://www.theage.com.au/frontpage/20000828/A32287-2000Aug28.html Translate elvi didn't correctly parse -from or -to HACKING file was missing from EXTRA_DIST Fri Aug 25 23:42:31 EST 2000 - Surfraw 1.0.1 New elvi: britannica Updated elvi: freshmeat Fri Aug 25 02:26:31 EST 2000 - Surfraw 0.5.8 New elvi: stockquote (nasdaq, quote.com, yahoo), jake Don't open new screen(1)s by default Zorch usage of local variables (not POSIX) Sat Aug 12 20:00:45 EST 2000 - Surfraw 0.5.7 New elvi: fast netbsd translate W wetandwild. Auto detect browser during configure phase. Built in support for screen(1) Built in support for netscape-remote `surfraw' on its own now displays a list of elvi Sun Aug 6 11:43:50 EST 2000 - Surfraw 0.5.6 New elvi: newscientist pubmed freshmeat Sat Aug 5 16:07:55 EST 2000 - Surfraw 0.5.5 New elvi: appwatch cnn excite ftpsearch linuxdoc scaleplus sundocs sunsolve thesaurus weather webster Wed Aug 2 08:56:04 EST 2000 Name change, surfaw -> surfraw Web-site is now http://surfraw.sourceforge.net/ Sun Jul 30 17:51:50 EST 2000 - Surfaw 0.5.4 A Lazy sunday. A tired, but happy mood. The afternoon drowses by and we have the initial version. $Id$ diff --git a/README b/README index ffd046e..2102a29 100644 --- a/README +++ b/README @@ -1,399 +1,399 @@ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Home Page: http://surfraw.alioth.debian.org ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web New: http://surfraw.alioth.debian.org Old: http://surfraw.sourceforge.net/ Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, babelfish, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw abstracts the browser away from input. Doing so lets it get on with what it's good at. Browsing. Interpretation of linguistic forms is handed back to the shell, which is what it, and human beings are good at. Combined with netscape-remote or incremental text browsers, such as links (http://artax.karlin.mff.cuni.cz/~mikulas/links/), w3m (http://www.w3m.org/), and screen(1) a Surfraw liberateur is capable of navigating speeds that leave GUI tainted idolaters agape with fear and wonder. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Note that putting quotes round arguments works now, so you can do, for example: sr google foo "bar baz" bam and the quoting is passed on to the search engine. ADDING THE ELVI TO YOUR PATH If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (usually /usr/lib/surfraw or /usr/local/lib/surfraw/) to your path, either manually or using surfraw-update-path(1). CONFIG FILES Surfraw implements the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) Essentially this means global config will be in /etc/xdg/surfraw/ and local config will be in $HOME/.config/surfraw/. This can be modified by setting $XDG_CONFIG_DIRS and $XDG_CONFIG_HOME, see the spec for more details. If your system has a different sysconfdir set during configure, that will be used instead of /etc (for instance, /usr/local/etc). In the documentation below, only the default paths will be referred to. LOCAL ELVI Surfraw can use your own private elvi, store them in $HOME/.config/surfraw/elvi/. Local elvi will be listed separately at the end of 'surfraw -elvi'. Use existing elvi (e.g. google) as a template. If you think your elvi may be useful to others, consider submitting them to [email protected]. BOOKMARKS Surfraw now supports bookmarks. To add a bookmark, add it to to the global bookmark list in /etc/xdg/surfraw/bookmarks or to your personal bookmark list in $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks CUSTOM SEARCH Several elvi use a search engine with site: and inurl: keywords. The search engine used can be customized by setting the environment variable SURFRAW_customsearch_provider or using the command-line argument -customsearch= Currently google and duckduckgo are supported Examples: SURFRAW_customsearch_provider=duckduckgo sr mysqldoc -v=5.5 select sr pgdoc -customsearch=google -v=9.1 select The default is to use duckduckgo. Currently affected elvi: -mdn mysqldoc netbsd openbsd pgdoc phpdoc slinuxdoc +mdn mysqldoc netbsd openbsd pgdoc slinuxdoc INSTALLATION Surfraw is installed with the standard ./configure; make; make install procedure. See INSTALL for more details. If you obtained surfraw direct from the git repository rather than a release tarball, run ./prebuild to generate the autotools build files *before* running ./configure. Note that the opensearch elvis depends on the perl libraries WWW::OpenSearch, HTML::Parser and LWP (libwww-perl). If you don't want to install opensearch, use ./configure --disable-opensearch. Surfraw supports the following options to ./configure: --with-text-browser=BROWSER Use BROWSER as text-mode browser --with-graphical-browser=BROWSER Use BROWSER as graphical-mode browser --with-elvidir=DIR Use DIR as location for storing elvi --disable-opensearch Disable OpenSearch support --disable-sr Disable installing sr alias By default, the text and graphical browsers are detected from a list of installed browsers at configure time. elvidir defaults to $(libdir)/surfraw (probably /usr/local/lib/surfraw). EXAMPLES $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr wikipedia surfraw $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian OPTIONS Global options are common to all Surfraw elvi (clients). You can get a list of the currently installed elvi by just typing `surfraw -elvi'. For example: $ surfraw -elvi GLOBAL ELVI: W -- Activate Surfraw defined web-browser acronym -- Look for acronyms definitions (www.acronymfinder.com) ads -- Search SAO/NASA Astrophysics Data System alioth -- Search Alioth (alioth.debian.org) amazon -- Search the amazon.com bookstore archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/) archwiki -- Search the Arch Linux Wiki arxiv -- Search arXiv E-Print Archive for articles ask -- Question the web using Ask Jeeves (www.ask.com) aur -- Search aur.archlinux.org for PKGBUILDs austlii -- Search Australian Law docs (www.austlii.edu.au) bbcnews -- Search BBC News (news.bbc.co.uk) bing -- Search the web using Microsoft's Bing (www.bing.com) bookfinder -- Search for books using www.bookfinder.com bugmenot -- Bypass compulsory web registration with bugmenot.com bugzilla -- Search for bugs on Bugzilla bugtrackers cablesearch -- search for leaked diplomatic communications cia -- Search CIA documents at www.cia.gov cisco -- Search Cisco documentation (www.cisco.com) cite -- Search computer science papers (citeseerx.ist.psu.edu) cliki -- Search the common lisp wiki cnn -- Search on CNN (cnn.com) codesearch -- Search source code using Google Code Search (www.google.fr/codesearch) comlaw -- Search Australian Law using Comlaw (www.comlaw.gov.au) ctan -- Search the Comprehensive TeX Archive Network (ctan.org) currency -- Convert currencies with the Universal Currency Converter (www.xe.net/ucc) cve -- Search for CAN assignments in CVE debbugs -- Search the debian BTS (bugs.debian.org) debcodesearch -- Search debian source code debcontents -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) deblists -- Search debian mailing lists (lists.debian.org/search.html) deblogs -- Show changelogs for a package in Debian main (changelogs.debian.net) debpackages -- Search debian/ubuntu packages (packages.debian.org/packages.ubuntu.com) debpkghome -- Visit the home page for a Debian package debpts -- Search the Debian Package Tracking System (packages.qa.debian.org) debsec -- Search the Debian Security Tracker for CVE ids or package names debvcsbrowse -- Browse the VCS repository for a Debian package debwiki -- Search the Debian Wikis (wiki.debian.org & women.debian.org/wiki) deja -- Search usenet using Google Groups (groups.google.com) deli -- Search Delicious bookmarks discogs -- Search the Discogs database of music information (www.discogs.com) dmoz -- Search the Open Directory Project web directory (dmoz.org) duckduckgo -- Securely search the web using duckduckgo (www.duckduckgo.com) ebay -- Search the Ebay auction site etym -- Look up word origins at www.etymonline.com excite -- Search on Excite (www.excite.com) f5 -- Search F5 related information (www.f5.com) finkpkg -- Search Fink packages (pdb.finkproject.org) foldoc -- The Free On-Line Dictionary Of Computing (foldoc.org) freebsd -- Search FreeBSD related information (www.freebsd.org) freedb -- Search for cd track listings in FreeDB (www.freedb.org) freshmeat -- Search Freshmeat (www.freshmeat.net) fsfdir -- Search the FSF/UNESCO Free Software Directory (directory.fsf.org) gcache -- Search the web using Google cache (www.google.com) genbugs -- Search the Gentoo bug tracker (bugs.gentoo.org) genportage -- Search gentoo-portage.com for packages github -- Search GitHub (https://github.com) google -- Search the web using Google (www.google.com) gutenberg -- Search for books on Project Gutenberg (gutenberg.org) imdb -- Search the Internet Movie Database (www.imdb.com) ixquick -- Search the web using ixquick [HTTPS] (www.ixquick.com) jamendo -- Search Jamendo: free music with Creative Commons licenses (www.jamendo.com) javasun -- Search Java API docs (java.sun.com) jquery -- Search the jQuery documentation (api.jquery.com) l1sp -- Search lisp documentation lastfm -- Search last.fm leodict -- Search Leo's German <-> English dictionary (dict.leo.org) lsm -- Search the Linux Software Map macports -- Search macports packages (macports.org) mathworld -- Search Wolfram MathWorld mdn -- Search the mozilla developer network (developer.mozilla.org) mininova -- Search the mininova bittorent source. musicbrainz -- Search MusicBrainz (musicbrainz.org) mysqldoc -- Search mysql documentation (dev.mysql.com) netbsd -- Search NetBSD related information (www.netbsd.org) ntrs -- Search the NASA Technical Report Server openbsd -- Search OpenBSD related information (www.openbsd.org) openports -- search openports for OpenBSD packages opensearch -- Search an OpenSearch-enabled website oraclesearch -- Search an OpenSearch-enabled website pasearch -- Search the unofficial Penny Arcade archives (pipefour.org/pa) pgdoc -- Search postgres documentation (www.pgdoc.com) pgpkeys -- Search the PGP key database phpdoc -- Search php documentation (php.net) pin -- Search Pinboard bookmarks (http://pinboard.in) piratebay -- Search The Pirate Bay (http://thepiratebay.org) priberam -- Look up word in Priberam online dictionary (www.priberam.pt/dlpo) pubmed -- Search medical/molbio databases (www.ncbi.nlm.nih.gov) rae -- Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary) rfc -- Search RFCs (internet standards documents) rhyme -- Search for rhymes et al using Lycos Rhyme (rhyme.lycos.com) rpmsearch -- Search for RPMs in various distros scholar -- Search Google Scholar (scholar.google.com) scicom -- Search Scientific Commons scirus -- Search for science using Scirus (scirus.com) scitopia -- Search for science with scitopia.org scpan -- Search the Comprehensive Perl Archive Network (search.cpan.org) slashdot -- Search stories on Slashdot (www.slashdot.org) slinuxdoc -- Search entries in LDP (www.linuxdoc.org) sourceforge -- Search SourceForge (www.sourceforge.net) springer -- Search Springer for Books and Articles stack -- Search Stack Overflow stockquote -- Get a single stock quote (multiple providers) thesaurus -- Look up word in Merriam-Webster's Thesaurus (www.m-w.com) translate -- Translate human languages urban -- Search urbandictionary.com for a definition w3css -- Validate a CSS URL with the w3c CSS validator (jigsaw.w3.org/css-validator) w3html -- Validate a web page URL with the w3c validator (validator.w3.org) w3link -- Check web page links with the w3c linkchecker (validator.w3.org/checklink) w3rdf -- Validate a RDF URL with the w3c RDF validator (validator.w3.org) wayback -- Search The Internet Archive's Wayback Machine for a URL (archive.org) webster -- Look up word in Merriam-Webster's Dictionary (www.m-w.com) wetandwild -- Real time weather information (many sources) wikipedia -- Search the free encyclopedia wikipedia woffle -- Search the web using Woffle (localhost:8080) wolfram -- Ask questions of the computational knowledge engine worldwidescience -- Search for science with www.worldwidescience.org yahoo -- Search Yahoo categories (www.yahoo.com) yandex -- Search the web using Yandex (yandex.ru) youtube -- Search YouTube (www.youtube.com) yubnub -- Use the social command-line for the web (yubnub.org) All elvi have useful low calorie help, for example: Usage: rhyme [options] [search words]... Description: Surfraw search for rhymes and other word correlations using Lycos Rhyme (rhyme.lycos.com) Example: $ rhyme Julian $ rhyme -method=rel surfer Results: Hurclean St. Julien. surfboarder, bather, natator, swimmer Local options: -method= Type of word correlation to search for prefect | Perfect rhyme syn | Synonyms hom | Homophones cons | Consonsant rhymes only rel | Semantically related words sub | Phrases spell | Similar spellings pic | Pictures shake | Match with Shakespeare archives def Find wordnet definition Default: perfect Environment: SURFRAW_rhyme_method Global options: -browser=EXECUTABLE Set browser Default: sensible-browser -elvi List Surfraw mechanisms for conquering evil -escape-url-args=yes|no Apply url escaping to arguments Default: yes Environment: SURFRAW_escape_url_args -g | -graphical Get some windowed sin Default: yes Environment: SURFRAW_graphical -help What you're reading now, dude -lh | -local-help Just show elvi-specific help, not the global options -p | -print Just print search URL, don't pass to browser -o | -o=FILE Fetch URL and dump to stdout or FILE. -new[=yes|no] Start in a new window Default: no Environment: SURFRAW_new_window -t | -text Back to the yellow brick road -q | -quote Quote arguments with " characters Default: no Environment: SURFRAW_quote_args -version Display Surfraw version (2.2.7) -- End of options Copyright: Copyright (c) 2003-2013 The Surfraw-Devel Team <[email protected]> Copyright (c) 2000-2001 Julian Assange <[email protected]> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study If you just want to see the elvi-specific help, use elvi -lh or -local-help. The system wide configuration file can usually be found in /etc/xdg/surfraw/conf (but see 'Config files' above). This can be overridden by setting the environment variable SURFRAW_global_conf. Each user can also specify their own overrides, usually in $HOME/.config/surfraw/conf (again, see 'Config files' above). This can be overridden by setting SURFRAW_conf, either in the environment or the global config file. e.g SURFRAW_graphical_remote=yes SURFRAW_graphical_browser=mozilla SURFRAW_text_browser=w3m SURFRAW_pgpkeys_sigs=on INTEGRATION There is a browser plugin for Pentadactyl (a vimperator fork) at http://code.google.com/p/dactyl/issues/detail?id=320 For details, see: http://lists.alioth.debian.org/pipermail/surfraw-devel/2011-April/000916.html Code to integrate with uzbl is in examples/uzbl_load_url_from_surfraw RADICALIZATION Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submitting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on [email protected] _________________________________________________________________ README originally by Julian Assange Updated by Ian Beckwith _________________________________________________________________ See NEWS, and ChangeLog for a summary of changes. _________________________________________________________________ diff --git a/elvi/phpdoc b/elvi/phpdoc old mode 100755 new mode 100644 index ced083b..a21eba8 --- a/elvi/phpdoc +++ b/elvi/phpdoc @@ -1,25 +1,129 @@ #!/bin/sh -# [email protected] 20130923 -# elvis: phpdoc -- Search php documentation (php.net) +# elvis: phpdoc -- Search PHP documentation (php.net) +# Author: http://jonyamo.net + . surfraw || exit 1 +w3_config_hook () { + def SURFRAW_php_language "$SURFRAW_lang" + def SURFRAW_php_search "functions" +} + w3_usage_hook () { cat <<EOF -Usage: $w3_argv0 [search words]... +Usage: $w3_argv0 [options] [search-string] Description: - Surfraw search php documentation (php.net) + Surfraw search PHP documentation (php.net) + +Local options: + -l, -language= Two letter language code (resembles ISO country codes) + en | English (default) + pt | Brazilian Portuguese + zh | Chinese (Simplified) + fr | French + de | German + ja | Japanese + pl | Polish + ro | Romanian + fa | Persian + es | Spanish + tr | Turkish + Environment: SURFRAW_php_language, SURFRAW_lang + Default: en + + -s, -search= Specialized search on topic + all | All php.net sites + functions | Function search + manual | Online documentation + bugs | Bug database + news | News archive + changelogs | Changelogs + pear | Just pear.php.net + pecl | Just pecl.php.net + talks | Just talks.php.net + maillist | General mailing list + devlist | Developer mailing list + phpdoc | Documentation mailing list + Environment: SURFRAW_php_search + Default: functions + + -a, -all alias of -search=all + -f, -functions alias of -search=functions + -m, -manual alias of -search=manual + -b, -bugs alias of -search=bugs + -n, -news alias of -search=news + -c, -changelogs alias of -search=changelogs + -t, -talks alias of -search=talks + -maillist alias of -search=maillist + -devlist alias of -search=devlist + -phpdoc alias of -search=phpdoc EOF - w3_custom_search_usage w3_global_usage } +w3_parse_option_hook () { + opt="$1" + optarg="$2" + case "$opt" in + -language=*) setopt SURFRAW_php_language "$optarg" ;; + -l=*) setopt SURFRAW_php_language "$optarg" ;; + -search=*) setopt SURFRAW_php_search "$optarg" ;; + -s=*) setopt SURFRAW_php_search "$optarg" ;; + -a|-all) setopt SURFRAW_php_search "all" ;; + -f|-functions) setopt SURFRAW_php_search "functions" ;; + -m|-manual) setopt SURFRAW_php_search "manual" ;; + -b|-bugs) setopt SURFRAW_php_search "bugs" ;; + -n|-news) setopt SURFRAW_php_search "news" ;; + -c|-changelogs) setopt SURFRAW_php_search "changelogs" ;; + -t|-talks) setopt SURFRAW_php_search "talks" ;; + -maillist) setopt SURFRAW_php_search "maillist" ;; + -devlist) setopt SURFRAW_php_search "devlist" ;; + -phpdoc) setopt SURFRAW_php_search "phpdoc" ;; + *) return 1 ;; + esac + return 0 +} + w3_config w3_parse_args "$@" -if test -z "$w3_args" -then - w3_browse_url "http://www.php.net/docs.php" -else - w3_custom_search -s=php.net "$w3_shquoted_args" -fi +# w3_args now contains a list of arguments + +url="http://php.net/" +case "$SURFRAW_php_language" in + en) lang="en" ;; + pt) lang="pt_BR" ;; + zh) lang="zh" ;; + fr) lang="fr" ;; + de) lang="de" ;; + ja) lang="ja" ;; + pl) lang="pl" ;; + ro) lang="ro" ;; + fa) lang="fa" ;; + es) lang="es" ;; + tr) lang="tr" ;; + *) lang="en" ;; +esac + +case "$SURFRAW_php_search" in + all) search="all" ;; + functions) search="quickref" ;; + manual) search="manual" ;; + bugs) search="bugdb" ;; + news) search="news_archive" ;; + changelogs) search="changelogs" ;; + pear) search="pear" ;; + pecl) search="pecl" ;; + talks) search="talks" ;; + maillist) search="maillist" ;; + devlist) search="devlist" ;; + phpdoc) search="phpdoc" ;; + *) search="functions" ;; +esac + +if [ -n "$w3_args" ]; then + escaped_args=$(w3_url_of_arg $w3_args) + url="${url}search.php?lang=${lang}&show=${search}&pattern=${escaped_args}" +fi +w3_browse_url "$url" diff --git a/test/phpdoc.test b/test/phpdoc.test index 5eaafd7..6ff848d 100644 --- a/test/phpdoc.test +++ b/test/phpdoc.test @@ -1,2 +1,2 @@ -SURFRAW_customsearch_provider=duckduckgo phpdoc array_merge +phpdoc array_merge Merges the elements
tekkub/libdatabroker-1-1
d02e8580b4ccec18c5ed6fe1aecb01b4a4b7098e
Add pairs and ipairs iters, since we can't use the normal iters on our dataobjs
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index 364602e..f47c0cd 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,66 +1,90 @@ assert(LibStub, "LibDataBroker-1.1 requires LibStub") assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") -local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 3) +local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 4) if not lib then return end oldminor = oldminor or 0 lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks if oldminor < 2 then lib.domt = { __metatable = "access denied", __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } end if oldminor < 3 then lib.domt.__newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value, self) callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value, self) callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value, self) callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value, self) end end if oldminor < 2 then function lib:NewDataObject(name, dataobj) if self.proxystorage[name] then return end if dataobj then assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table") self.attributestorage[dataobj] = {} for i,v in pairs(dataobj) do self.attributestorage[dataobj][i] = v dataobj[i] = nil end end dataobj = setmetatable(dataobj or {}, self.domt) self.proxystorage[name], self.namestorage[dataobj] = dataobj, name self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end end if oldminor < 1 then function lib:DataObjectIterator() return pairs(self.proxystorage) end function lib:GetDataObjectByName(dataobjectname) return self.proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return self.namestorage[dataobject] end end + +if oldminor < 4 then + local next = pairs(attributestorage) + function lib:pairs(dataobject_or_name) + local t = type(dataobject_or_name) + assert(t == "string" or t == "table", "Usage: ldb:pairs('dataobjectname') or ldb:pairs(dataobject)") + + local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name + assert(attributestorage[dataobj], "Data object not found") + + return next, attributestorage[dataobj], nil + end + + local ipairs_iter = ipairs(attributestorage) + function lib:ipairs(dataobject_or_name) + local t = type(dataobject_or_name) + assert(t == "string" or t == "table", "Usage: ldb:ipairs('dataobjectname') or ldb:ipairs(dataobject)") + + local dataobj = self.proxystorage[dataobject_or_name] or dataobject_or_name + assert(attributestorage[dataobj], "Data object not found") + + return ipairs_iter, attributestorage[dataobj], 0 + end +end
tekkub/libdatabroker-1-1
66840219622309aa60fb721b273cde82519f4130
Simplify readme, all docs have been moved into GitHub wiki pages
diff --git a/README.textile b/README.textile index 7ec2e06..ef16fed 100644 --- a/README.textile +++ b/README.textile @@ -1,180 +1,13 @@ +LibDataBroker is a small WoW addon library designed to provide a "MVC":http://en.wikipedia.org/wiki/Model-view-controller interface for use in various addons. +LDB's primary goal is to "detach" plugins for TitanPanel and FuBar from the display addon. +Plugins can provide data into a simple table, and display addons can receive callbacks to refresh their display of this data. +LDB also provides a place for addons to register "quicklaunch" functions, removing the need for authors to embed many large libraries to create minimap buttons. +Users who do not wish to be "plagued" by these buttons simply do not install an addon to render them. -h2. Using LibDataBroker-1.1 +Due to it's simple generic design, LDB can be used for any design where you wish to have an addon notified of changes to a table. -h3. Embedding the library +h2. Links -LibDataBroker is designed to be embedded into the addons that use it. -The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. - -Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. -Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. -If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. - -h3. Providing a dataobject - -Before anyone can do anything, we need some data to display. -For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. -This implements the "Quicklauncher" spec below to create a button to open our config panel. - -<pre> -LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { - launcher = true, - icon = "Interface\\Icons\\Spell_Nature_StormReach", - OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, -}) -</pre> - -Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. -This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. - -<pre> -local UPDATEPERIOD, elapsed = 0.5, 0 -local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) -local f = CreateFrame("frame") - -f:SetScript("OnUpdate", function(self, elap) - elapsed = elapsed + elap - if elapsed < UPDATEPERIOD then return end - - elapsed = 0 - local fps = GetFramerate() - dataobj.text = string_format("%.1f FPS", fps) -end) - -function dataobj.OnEnter(self) - GameTooltip:SetOwner(self, "ANCHOR_NONE") - GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") - GameTooltip:ClearLines() - GameTooltip:AddLine("myFPS") - GameTooltip:Show() -end - -function dataobj.OnLeave() - GameTooltip:Hide() -end -</pre> - -Here our dataobject gets updated every half-second with the current FPS. -We also provide OnEnter and OnLeave script handlers. -If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. - -h3. Using a dataobject - -So, we have a source of data now, how do we pull it into an addon and know when to update things? Easy! -LDB uses Ace3's "CallbackHandler":http://www.wowace.com/wiki/CallbackHandler-1.0 to trigger callbacks in nearly the exact same way as "AceEvent3":http://www.wowace.com/wiki/AceEvent-3.0 does. - -h4. Registering a callback - -To receive updates from the library, we must register a callback function. There are three ways you can call <code>RegisterCallback</code> - -<pre> -local ldb = LibStub:GetLibrary("LibDataBroker-1.1") -myTable.RegisterLDBCallback = ldb.RegisterCallback - -myTable:RegisterLDBCallback("eventName"[, method[, arg]]) -ldb.RegisterCallback(myTable, "eventName"[, method[, arg]]) -ldb.RegisterCallback("myAddonId", "eventName"[, method[, arg]]) -</pre> - -|_. Arg |_. Type |_. Description | -|_. "eventName" | string | The name of the event you want to listen to. | -|_. method | string or function | Which method to call. If string, self["method"] will be called. If left out (nil), self["eventName"] will be called. | -|_. arg | optional | If present (even nil), this value will be passed to the receiving function. | - -h4. Callback events - -LDB provides 5 basic callbacks, one that is fired for for new dataobject registrations, and 4 that are fired any time a dataobject attribute is changed. - -|_. Event name |_. Args passed |_. Description | -|_. LibDataBroker_DataObjectCreated | name, dataobj | Fires when a new dataobject is created. Passes the DO's name and object. | -|_. LibDataBroker_AttributeChanged | name, attr, value, dataobj | Fires for ALL attribute changes across ALL dataobjects. Passes the DO name, name of the attribute changed, new value of the attribute, and the dataobject. | -|_. LibDataBroker_AttributeChanged_&lt;name> | name, attr, value, dataobj | Fires for ALL attribute changes on the named dataobject. Passes the same args as <code>LibDataBroker_AttributeChanged</code> | -|_. LibDataBroker_AttributeChanged_&lt;name>_&lt;attr> | name, attr, value, dataobj | Fires for changes to the named attribute on the named dataobject. Passes the same args as <code>LibDataBroker_AttributeChanged</code> | -|_. LibDataBroker_AttributeChanged__&lt;attr> | name, attr, value, dataobj | Fires for changes to the named attribute across ALL dataobjects. Passes the same args as <code>LibDataBroker_AttributeChanged</code> | - -h4. Example - -This code will register the "all changes" callback and print to the chat frame any time an attribute is changed on any dataobject. - -<pre> -local function mycallback(event, name, key, value, dataobj) - ChatFrame1:AddMessage("LDB: "..name.. ".".. key.. " was changed to ".. tostring(value)) -end -LibStub:GetLibrary("LibDataBroker-1.1").RegisterCallback("MyAnonCallback", "LibDataBroker_AttributeChanged", mycallback) -</pre> - -h3. Other API - -LDB also provides a few basic functions for accessing dataobjects. - -|_. Function |_. Description | -|_. ldb:GetDataObjectByName(dataobjectname) | Retrieve a dataobject | -|_. ldb:GetNameByDataObject(dataobject) | Lookup a dataobject's name | -|_. ldb.DataObjectIterator() | Iter over all registered dataobjects. Works like <code>pairs</code><br/><pre>for name,dataobj in ldb.DataObjectIterator() do ...</pre> | - -h2. Data Specifications - -Provided below are two suggested data specs. -These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. - -h3. Data Display - -Data display addons provide a LDB "feed" for an always-up addon to display. -These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. -Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. - -h4. Fields - -|_. text _Required_ | The text to be shown. | -|_. label | A title for your feed, often shown to the left of the text, user might choose to hide this. | -|_. icon | Full path to a texture, often shown to the left of the label or text. | -|_. OnClick | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | -|_. tooltiptext | A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. | -|_. OnTooltipShow | A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. | -|_. OnEnter | An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. | -|_. OnLeave | An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. | -|_. tooltip | A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. | - -h3. Quicklauncher - -A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. - -<em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> - -h4. Fields - -|_. launcher _Required_ | Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. | -|_. icon _Required_ | Full path to a texture for display. | -|_. OnClick _Required_ | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | -|_. tocname | The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. | -|_. label | A label to use for the launcher, overriding the dataobject name. | - -h2. Addons using LDB - -<div style="float:left; margin-right:2em;"> - -h3. Data Display addons - -* Fortress (Unreleased) -* StatBlockCore (Unreleased) -* tekBlocks (Unreleased) - -</div> - -<div style="float:left; margin-right:2em;"> - -h3. Quicklaunch addons - -* "Quickie":http://github.com/tekkub/quickie (Proof of concept) - -</div> - -<div style="float:left; margin-right:2em;"> - -h3. Misc - -* FuBar2LDB (Unreleased) - -</div> - -<br style="clear:both" /> +* "API documentation":http://github.com/tekkub/libdatabroker-1-1/wikis/api +* "Data specifications":http://github.com/tekkub/libdatabroker-1-1/wikis/data-specifications +* "Addons using LDB":http://github.com/tekkub/libdatabroker-1-1/wikis/addons-using-ldb
tekkub/libdatabroker-1-1
1ec2d8b707612e175ab3b48c6a743f7a364da7c9
Documentation on how to use LDB data (for display addons)
diff --git a/README.textile b/README.textile index 527f7c5..7ec2e06 100644 --- a/README.textile +++ b/README.textile @@ -1,126 +1,180 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. +h3. Using a dataobject + +So, we have a source of data now, how do we pull it into an addon and know when to update things? Easy! +LDB uses Ace3's "CallbackHandler":http://www.wowace.com/wiki/CallbackHandler-1.0 to trigger callbacks in nearly the exact same way as "AceEvent3":http://www.wowace.com/wiki/AceEvent-3.0 does. + +h4. Registering a callback + +To receive updates from the library, we must register a callback function. There are three ways you can call <code>RegisterCallback</code> + +<pre> +local ldb = LibStub:GetLibrary("LibDataBroker-1.1") +myTable.RegisterLDBCallback = ldb.RegisterCallback + +myTable:RegisterLDBCallback("eventName"[, method[, arg]]) +ldb.RegisterCallback(myTable, "eventName"[, method[, arg]]) +ldb.RegisterCallback("myAddonId", "eventName"[, method[, arg]]) +</pre> + +|_. Arg |_. Type |_. Description | +|_. "eventName" | string | The name of the event you want to listen to. | +|_. method | string or function | Which method to call. If string, self["method"] will be called. If left out (nil), self["eventName"] will be called. | +|_. arg | optional | If present (even nil), this value will be passed to the receiving function. | + +h4. Callback events + +LDB provides 5 basic callbacks, one that is fired for for new dataobject registrations, and 4 that are fired any time a dataobject attribute is changed. + +|_. Event name |_. Args passed |_. Description | +|_. LibDataBroker_DataObjectCreated | name, dataobj | Fires when a new dataobject is created. Passes the DO's name and object. | +|_. LibDataBroker_AttributeChanged | name, attr, value, dataobj | Fires for ALL attribute changes across ALL dataobjects. Passes the DO name, name of the attribute changed, new value of the attribute, and the dataobject. | +|_. LibDataBroker_AttributeChanged_&lt;name> | name, attr, value, dataobj | Fires for ALL attribute changes on the named dataobject. Passes the same args as <code>LibDataBroker_AttributeChanged</code> | +|_. LibDataBroker_AttributeChanged_&lt;name>_&lt;attr> | name, attr, value, dataobj | Fires for changes to the named attribute on the named dataobject. Passes the same args as <code>LibDataBroker_AttributeChanged</code> | +|_. LibDataBroker_AttributeChanged__&lt;attr> | name, attr, value, dataobj | Fires for changes to the named attribute across ALL dataobjects. Passes the same args as <code>LibDataBroker_AttributeChanged</code> | + +h4. Example + +This code will register the "all changes" callback and print to the chat frame any time an attribute is changed on any dataobject. + +<pre> +local function mycallback(event, name, key, value, dataobj) + ChatFrame1:AddMessage("LDB: "..name.. ".".. key.. " was changed to ".. tostring(value)) +end +LibStub:GetLibrary("LibDataBroker-1.1").RegisterCallback("MyAnonCallback", "LibDataBroker_AttributeChanged", mycallback) +</pre> + +h3. Other API + +LDB also provides a few basic functions for accessing dataobjects. + +|_. Function |_. Description | +|_. ldb:GetDataObjectByName(dataobjectname) | Retrieve a dataobject | +|_. ldb:GetNameByDataObject(dataobject) | Lookup a dataobject's name | +|_. ldb.DataObjectIterator() | Iter over all registered dataobjects. Works like <code>pairs</code><br/><pre>for name,dataobj in ldb.DataObjectIterator() do ...</pre> | + h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields |_. text _Required_ | The text to be shown. | |_. label | A title for your feed, often shown to the left of the text, user might choose to hide this. | |_. icon | Full path to a texture, often shown to the left of the label or text. | |_. OnClick | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tooltiptext | A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. | |_. OnTooltipShow | A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. | |_. OnEnter | An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. | |_. OnLeave | An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. | |_. tooltip | A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. | h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields |_. launcher _Required_ | Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. | |_. icon _Required_ | Full path to a texture for display. | |_. OnClick _Required_ | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tocname | The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. | |_. label | A label to use for the launcher, overriding the dataobject name. | h2. Addons using LDB <div style="float:left; margin-right:2em;"> h3. Data Display addons -* "Fortress":http://www.wowace.com/forums/index.php?topic=14158.0 (Unreleased) -* "StatBlockCore":http://www.wowace.com/forums/index.php?topic=14160.0 (Unreleased) +* Fortress (Unreleased) +* StatBlockCore (Unreleased) * tekBlocks (Unreleased) </div> <div style="float:left; margin-right:2em;"> h3. Quicklaunch addons * "Quickie":http://github.com/tekkub/quickie (Proof of concept) </div> <div style="float:left; margin-right:2em;"> h3. Misc * FuBar2LDB (Unreleased) </div> <br style="clear:both" />
tekkub/libdatabroker-1-1
6f130570deb4a65409e0940f3268e335ff29645f
Add StatBlockCore forum link
diff --git a/README.textile b/README.textile index 7dbc41b..527f7c5 100644 --- a/README.textile +++ b/README.textile @@ -1,126 +1,126 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields |_. text _Required_ | The text to be shown. | |_. label | A title for your feed, often shown to the left of the text, user might choose to hide this. | |_. icon | Full path to a texture, often shown to the left of the label or text. | |_. OnClick | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tooltiptext | A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. | |_. OnTooltipShow | A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. | |_. OnEnter | An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. | |_. OnLeave | An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. | |_. tooltip | A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. | h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields |_. launcher _Required_ | Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. | |_. icon _Required_ | Full path to a texture for display. | |_. OnClick _Required_ | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tocname | The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. | |_. label | A label to use for the launcher, overriding the dataobject name. | h2. Addons using LDB <div style="float:left; margin-right:2em;"> h3. Data Display addons * "Fortress":http://www.wowace.com/forums/index.php?topic=14158.0 (Unreleased) -* StatBlockCore (Unreleased) +* "StatBlockCore":http://www.wowace.com/forums/index.php?topic=14160.0 (Unreleased) * tekBlocks (Unreleased) </div> <div style="float:left; margin-right:2em;"> h3. Quicklaunch addons * "Quickie":http://github.com/tekkub/quickie (Proof of concept) </div> <div style="float:left; margin-right:2em;"> h3. Misc * FuBar2LDB (Unreleased) </div> <br style="clear:both" />
tekkub/libdatabroker-1-1
17be81342c21f6c2b4be83a84f92a2c45cc8f163
Add link to Fortress thread
diff --git a/README.textile b/README.textile index b1759bd..7dbc41b 100644 --- a/README.textile +++ b/README.textile @@ -1,126 +1,126 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields |_. text _Required_ | The text to be shown. | |_. label | A title for your feed, often shown to the left of the text, user might choose to hide this. | |_. icon | Full path to a texture, often shown to the left of the label or text. | |_. OnClick | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tooltiptext | A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. | |_. OnTooltipShow | A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. | |_. OnEnter | An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. | |_. OnLeave | An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. | |_. tooltip | A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. | h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields |_. launcher _Required_ | Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. | |_. icon _Required_ | Full path to a texture for display. | |_. OnClick _Required_ | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tocname | The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. | |_. label | A label to use for the launcher, overriding the dataobject name. | h2. Addons using LDB <div style="float:left; margin-right:2em;"> h3. Data Display addons -* Fortress (Unreleased) +* "Fortress":http://www.wowace.com/forums/index.php?topic=14158.0 (Unreleased) * StatBlockCore (Unreleased) * tekBlocks (Unreleased) </div> <div style="float:left; margin-right:2em;"> h3. Quicklaunch addons * "Quickie":http://github.com/tekkub/quickie (Proof of concept) </div> <div style="float:left; margin-right:2em;"> h3. Misc * FuBar2LDB (Unreleased) </div> <br style="clear:both" />
tekkub/libdatabroker-1-1
073a8744d642f70436a30472dbf168601cd1eb92
And rearrange the addon list a bit too
diff --git a/README.textile b/README.textile index 01491b6..b1759bd 100644 --- a/README.textile +++ b/README.textile @@ -1,112 +1,126 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields |_. text _Required_ | The text to be shown. | |_. label | A title for your feed, often shown to the left of the text, user might choose to hide this. | |_. icon | Full path to a texture, often shown to the left of the label or text. | |_. OnClick | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tooltiptext | A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. | |_. OnTooltipShow | A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. | |_. OnEnter | An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. | |_. OnLeave | An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. | |_. tooltip | A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. | h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields |_. launcher _Required_ | Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. | |_. icon _Required_ | Full path to a texture for display. | |_. OnClick _Required_ | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | |_. tocname | The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. | |_. label | A label to use for the launcher, overriding the dataobject name. | h2. Addons using LDB +<div style="float:left; margin-right:2em;"> + h3. Data Display addons * Fortress (Unreleased) * StatBlockCore (Unreleased) * tekBlocks (Unreleased) +</div> + +<div style="float:left; margin-right:2em;"> + h3. Quicklaunch addons * "Quickie":http://github.com/tekkub/quickie (Proof of concept) +</div> + +<div style="float:left; margin-right:2em;"> + h3. Misc * FuBar2LDB (Unreleased) + +</div> + +<br style="clear:both" />
tekkub/libdatabroker-1-1
6146a32b9d5619b050820acacc795ef4fa69f707
Make field lists into nice pretty tables
diff --git a/README.textile b/README.textile index 57dd688..01491b6 100644 --- a/README.textile +++ b/README.textile @@ -1,112 +1,112 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields -* "text" (Required) - the text to be shown -* "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. -* "icon" - Full path to a texture, often shown to the left of the label or text. -* "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). -* "tooltiptext" - A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. -* "OnTooltipShow" - A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. -* "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. -* "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. -* "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. +|_. text _Required_ | The text to be shown. | +|_. label | A title for your feed, often shown to the left of the text, user might choose to hide this. | +|_. icon | Full path to a texture, often shown to the left of the label or text. | +|_. OnClick | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | +|_. tooltiptext | A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. | +|_. OnTooltipShow | A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. | +|_. OnEnter | An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. | +|_. OnLeave | An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. | +|_. tooltip | A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. | h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields -* "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. -* "icon" (Required) - Full path to a texture for display. -* "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). -* "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. -* "label" - A label to use for the launcher, overriding the dataobject name. +|_. launcher _Required_ | Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. | +|_. icon _Required_ | Full path to a texture for display. | +|_. OnClick _Required_ | An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). | +|_. tocname | The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. | +|_. label | A label to use for the launcher, overriding the dataobject name. | h2. Addons using LDB h3. Data Display addons * Fortress (Unreleased) * StatBlockCore (Unreleased) * tekBlocks (Unreleased) h3. Quicklaunch addons * "Quickie":http://github.com/tekkub/quickie (Proof of concept) h3. Misc * FuBar2LDB (Unreleased)
tekkub/libdatabroker-1-1
33c67b1dee972bafe936cd79fe75ffd539554feb
Add list of who is using LDB
diff --git a/README.textile b/README.textile index d227f7d..57dd688 100644 --- a/README.textile +++ b/README.textile @@ -1,96 +1,112 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields * "text" (Required) - the text to be shown * "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. * "icon" - Full path to a texture, often shown to the left of the label or text. * "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tooltiptext" - A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. * "OnTooltipShow" - A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. * "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. * "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. * "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields * "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. * "icon" (Required) - Full path to a texture for display. * "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. * "label" - A label to use for the launcher, overriding the dataobject name. + +h2. Addons using LDB + +h3. Data Display addons + +* Fortress (Unreleased) +* StatBlockCore (Unreleased) +* tekBlocks (Unreleased) + +h3. Quicklaunch addons + +* "Quickie":http://github.com/tekkub/quickie (Proof of concept) + +h3. Misc + +* FuBar2LDB (Unreleased)
tekkub/libdatabroker-1-1
0617fd1e5f1c4838f76acd78e57c8a1895843576
Always with the typos, I hate my fingers
diff --git a/README.textile b/README.textile index 0367f3b..d227f7d 100644 --- a/README.textile +++ b/README.textile @@ -1,96 +1,96 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields * "text" (Required) - the text to be shown * "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. * "icon" - Full path to a texture, often shown to the left of the label or text. * "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tooltiptext" - A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. -* "OnTooltipShow" - A function to call when the display wants to show a tooltip. The display wil manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. +* "OnTooltipShow" - A function to call when the display wants to show a tooltip. The display will manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. * "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. * "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. * "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields * "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. * "icon" (Required) - Full path to a texture for display. * "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. * "label" - A label to use for the launcher, overriding the dataobject name.
tekkub/libdatabroker-1-1
19674c66a17120bf5d2d9fb0f287ccbdcca3a1d0
Add tooltiptext and OnTooltipShow to data addon spec
diff --git a/README.textile b/README.textile index 7e6ae3f..0367f3b 100644 --- a/README.textile +++ b/README.textile @@ -1,94 +1,96 @@ h2. Using LibDataBroker-1.1 h3. Embedding the library LibDataBroker is designed to be embedded into the addons that use it. The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LDB. h3. Providing a dataobject Before anyone can do anything, we need some data to display. For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. This implements the "Quicklauncher" spec below to create a button to open our config panel. <pre> LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { launcher = true, icon = "Interface\\Icons\\Spell_Nature_StormReach", OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, }) </pre> Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. <pre> local UPDATEPERIOD, elapsed = 0.5, 0 local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) local f = CreateFrame("frame") f:SetScript("OnUpdate", function(self, elap) elapsed = elapsed + elap if elapsed < UPDATEPERIOD then return end elapsed = 0 local fps = GetFramerate() dataobj.text = string_format("%.1f FPS", fps) end) function dataobj.OnEnter(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") GameTooltip:ClearLines() GameTooltip:AddLine("myFPS") GameTooltip:Show() end function dataobj.OnLeave() GameTooltip:Hide() end </pre> Here our dataobject gets updated every half-second with the current FPS. We also provide OnEnter and OnLeave script handlers. If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields * "text" (Required) - the text to be shown * "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. * "icon" - Full path to a texture, often shown to the left of the label or text. * "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). +* "tooltiptext" - A string for the display addon to pass directly to GameTooltip:SetText() when a tooltip is needed. +* "OnTooltipShow" - A function to call when the display wants to show a tooltip. The display wil manage positioning, clearing and showing the tooltip, all this handler needs to do is populate the tooltip using :AddLine or similar. The display should pass the tooltip to this callback, in case it isn't using GameTooltip. * "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. * "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. * "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields * "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. * "icon" (Required) - Full path to a texture for display. * "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. * "label" - A label to use for the launcher, overriding the dataobject name.
tekkub/libdatabroker-1-1
5ae78829a48f70e3fba22cddf0a11acc026ebd56
Add in some documentation on how to push data into LDB
diff --git a/README.textile b/README.textile index a5643d8..83aeffd 100644 --- a/README.textile +++ b/README.textile @@ -1,39 +1,94 @@ h2. Using LibDataBroker-1.1 -<em> Coming soon to a README near you! </em> +h3. Embedding the library + +LDB is designed to be embedded into the addons that use it. +The user should never have to worry about what version of the library they have, or even really be aware of the library's existence. + +Embedding the library is a fairly simple task. Simply include LibDataBroker-1.1.lua in your addon's files and add it into your TOC to be loaded. +Make sure that you include "LibStub":http://www.wowwiki.com/LibStub and "CallbackHandler-1.0":http://www.wowace.com/wiki/CallbackHandler-1.0 as well, and that they load before LDB. +If you use Ace3 in your addon, you probably already have LibStub and CallbackHandler, just make sure they're loaded before LibDataBroker. + +h3. Providing a dataobject + +Before anyone can do anything, we need some data to display. +For our first example, we'll provide a static dataobject that is simply declared on load and never changed after that. +This implements the "Quicklauncher" spec below to create a button to open our config panel. + +<pre> +LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("MyAddonName", { + launcher = true, + icon = "Interface\\Icons\\Spell_Nature_StormReach", + OnClick = function(clickedframe, button) InterfaceOptionsFrame_OpenToFrame(myconfigframe) end, +}) +</pre> + +Pretty simple eh? Now why don't we make a dataobject that implements the "data display" spec. +This data can be used by a display addon to create an always-up frame, like a FuBar plugin would. + +<pre> +local UPDATEPERIOD, elapsed = 0.5, 0 +local dataobj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("myFPS", {text = "75.0 FPS"}) +local f = CreateFrame("frame") + +f:SetScript("OnUpdate", function(self, elap) + elapsed = elapsed + elap + if elapsed < UPDATEPERIOD then return end + + elapsed = 0 + local fps = GetFramerate() + dataobj.text = string_format("%.1f|r FPS", fps) +end) + +function dataobj.OnEnter(self) + GameTooltip:SetOwner(self, "ANCHOR_NONE") + GameTooltip:SetPoint("TOPLEFT", self, "BOTTOMLEFT") + GameTooltip:ClearLines() + GameTooltip:AddLine("myFPS") + GameTooltip:Show() +end + +function dataobj.OnLeave() + GameTooltip:Hide() +end +</pre> + +Here our dataobject gets updated every half-second with the current FPS. +We also provide OnEnter and OnLeave script handlers. +If the display addon chooses to attach these to the frame it uses for our data, the user will get a tooltip when they hover over that frame. h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields * "text" (Required) - the text to be shown * "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. * "icon" - Full path to a texture, often shown to the left of the label or text. * "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. * "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. * "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. <em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields * "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. * "icon" (Required) - Full path to a texture for display. * "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. * "label" - A label to use for the launcher, overriding the dataobject name.
tekkub/libdatabroker-1-1
b190611e12376e940b92c2ef2b672ac19b8fc0d0
Meh, fuck you textile
diff --git a/README.textile b/README.textile index c337de4..a5643d8 100644 --- a/README.textile +++ b/README.textile @@ -1,39 +1,39 @@ h2. Using LibDataBroker-1.1 -_ Coming soon to a README near you! _ +<em> Coming soon to a README near you! </em> h2. Data Specifications Provided below are two suggested data specs. These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. h3. Data Display Data display addons provide a LDB "feed" for an always-up addon to display. These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. h4. Fields * "text" (Required) - the text to be shown * "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. * "icon" - Full path to a texture, often shown to the left of the label or text. * "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. * "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. * "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. h3. Quicklauncher A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. -* Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. * +<em> Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. </em> h4. Fields * "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. * "icon" (Required) - Full path to a texture for display. * "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). * "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. * "label" - A label to use for the launcher, overriding the dataobject name.
tekkub/libdatabroker-1-1
c947601d755eeaa8ce3bf4726f3094fe4fe16d39
Adding readme
diff --git a/README.textile b/README.textile new file mode 100644 index 0000000..c337de4 --- /dev/null +++ b/README.textile @@ -0,0 +1,39 @@ + +h2. Using LibDataBroker-1.1 + +_ Coming soon to a README near you! _ + +h2. Data Specifications + +Provided below are two suggested data specs. +These specs are very open to modification and enhancement by display addons, but plugins providing data should not expect that anything except the required fields are supported in the display. + +h3. Data Display + +Data display addons provide a LDB "feed" for an always-up addon to display. +These addons can be thought of like RSS feeds, where the display addon is similar to an RSS reader. +Display addons could include FuBar, Titan Panel, StatBlocks, LegoBlocks, or any other design out there. + +h4. Fields + +* "text" (Required) - the text to be shown +* "label" - A title for your feed, often shown to the left of the text, user might choose to hide this. +* "icon" - Full path to a texture, often shown to the left of the label or text. +* "OnClick" - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). +* "OnEnter" - An OnEnter script handler to be directly attached to the display frame. Usually used to display a tooltip. This handler should check the position of the frame it is passed and anchor the tolltip to that frame accordingly. +* "OnLeave" - An OnLeave script handler to be directly attached to the display frame. Usually used to hide the toolip. +* "tooltip" - A frame to be displayed when the display frame is entered. The display addon is responsible for anchoring, showing and hiding this frame as needed. The tooltip frame's OnShow can be used to refresh the frame. Note that this frame doesn't have to be a GameTooltip. + +h3. Quicklauncher + +A quicklauncher is a LDB object that does not provide any data, but instead provides an OnClick handler to allow fast access to config panels, toggle settings, or perform other actions. + +* Quicklaunchers should never expect a secure frame to be used, therefore actions like spellcasting are not possible. * + +h4. Fields + +* "launcher" (Required) - Set to true, indicates that this data object is a launcher and does not provide any data to be rendered in an always-up frame. +* "icon" (Required) - Full path to a texture for display. +* "OnClick" (Required) - An OnClick script handler to be directly attached to the display frame. Receives the usual args an OnClick receives (self, button). +* "tocname" - The name of the addon providing the launcher, if it's name does not match the dataobject's name. Used by displays to get TOC metadata about the addon. +* "label" - A label to use for the launcher, overriding the dataobject name.
tekkub/libdatabroker-1-1
92347c5d8c444c1273c43d388913cf2b847cebfa
Pass current dataobj with attr change callbacks to avoid excessive calls to :GetDataObjectByName
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index aa055aa..364602e 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,61 +1,66 @@ assert(LibStub, "LibDataBroker-1.1 requires LibStub") assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") -local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 2) +local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 3) if not lib then return end oldminor = oldminor or 0 lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks -lib.domt = lib.domt or { - __metatable = "access denied", - __newindex = function(self, key, value) +if oldminor < 2 then + lib.domt = { + __metatable = "access denied", + __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, + } +end + +if oldminor < 3 then + lib.domt.__newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end - callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) - callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) - callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) - callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) - end, - __index = function(self, key) - return attributestorage[self] and attributestorage[self][key] - end, -} - -function lib:NewDataObject(name, dataobj) - if self.proxystorage[name] then return end - - if dataobj then - assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table") - self.attributestorage[dataobj] = {} - for i,v in pairs(dataobj) do - self.attributestorage[dataobj][i] = v - dataobj[i] = nil + callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value, self) + callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value, self) + callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value, self) + callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value, self) + end +end + +if oldminor < 2 then + function lib:NewDataObject(name, dataobj) + if self.proxystorage[name] then return end + + if dataobj then + assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table") + self.attributestorage[dataobj] = {} + for i,v in pairs(dataobj) do + self.attributestorage[dataobj][i] = v + dataobj[i] = nil + end end + dataobj = setmetatable(dataobj or {}, self.domt) + self.proxystorage[name], self.namestorage[dataobj] = dataobj, name + self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) + return dataobj end - dataobj = setmetatable(dataobj or {}, self.domt) - self.proxystorage[name], self.namestorage[dataobj] = dataobj, name - self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) - return dataobj end if oldminor < 1 then function lib:DataObjectIterator() return pairs(self.proxystorage) end function lib:GetDataObjectByName(dataobjectname) return self.proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return self.namestorage[dataobject] end end
tekkub/libdatabroker-1-1
1498b61a82f682d616efb4c3db153ac5f21b8616
Make passed dataobj actually work
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index fe43648..aa055aa 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,54 +1,61 @@ assert(LibStub, "LibDataBroker-1.1 requires LibStub") assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 2) if not lib then return end oldminor = oldminor or 0 lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks lib.domt = lib.domt or { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject(name, dataobj) if self.proxystorage[name] then return end - assert(type(dataobj) == "table" or type(dataobj) == "nil", "Invalid dataobj, must be nil or a table") + if dataobj then + assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table") + self.attributestorage[dataobj] = {} + for i,v in pairs(dataobj) do + self.attributestorage[dataobj][i] = v + dataobj[i] = nil + end + end dataobj = setmetatable(dataobj or {}, self.domt) self.proxystorage[name], self.namestorage[dataobj] = dataobj, name self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end if oldminor < 1 then function lib:DataObjectIterator() return pairs(self.proxystorage) end function lib:GetDataObjectByName(dataobjectname) return self.proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return self.namestorage[dataobject] end end
tekkub/libdatabroker-1-1
7782df3c98d115d8580e19ee093442446e9dba30
I always forget the 'then'
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index c6807de..fe43648 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,54 +1,54 @@ assert(LibStub, "LibDataBroker-1.1 requires LibStub") assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 2) if not lib then return end oldminor = oldminor or 0 lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks lib.domt = lib.domt or { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject(name, dataobj) if self.proxystorage[name] then return end assert(type(dataobj) == "table" or type(dataobj) == "nil", "Invalid dataobj, must be nil or a table") dataobj = setmetatable(dataobj or {}, self.domt) self.proxystorage[name], self.namestorage[dataobj] = dataobj, name self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end -if oldminor < 1 +if oldminor < 1 then function lib:DataObjectIterator() return pairs(self.proxystorage) end function lib:GetDataObjectByName(dataobjectname) return self.proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return self.namestorage[dataobject] end end
tekkub/libdatabroker-1-1
bdbc513351e02e6907b192915f49c71275658b82
Minor memory optimization - Only hold upvalues to locals in the functions called frequently - Retain the metatable across future lib upgrades (the one in v1 will be lost)
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index 3617bbe..c6807de 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,54 +1,54 @@ assert(LibStub, "LibDataBroker-1.1 requires LibStub") assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 2) if not lib then return end oldminor = oldminor or 0 lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} -local attributestorage, namestorage, proxystorage = lib.attributestorage, lib.namestorage, lib.proxystorage +local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks -local domt = { +lib.domt = lib.domt or { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end - lib.callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) - lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) - lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) - lib.callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) + callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) + callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) + callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) + callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject(name, dataobj) - if proxystorage[name] then return end + if self.proxystorage[name] then return end assert(type(dataobj) == "table" or type(dataobj) == "nil", "Invalid dataobj, must be nil or a table") dataobj = setmetatable(dataobj or {}, self.domt) - proxystorage[name], namestorage[dataobj] = dataobj, name - lib.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) + self.proxystorage[name], self.namestorage[dataobj] = dataobj, name + self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end if oldminor < 1 function lib:DataObjectIterator() - return pairs(proxystorage) + return pairs(self.proxystorage) end function lib:GetDataObjectByName(dataobjectname) - return proxystorage[dataobjectname] + return self.proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) - return namestorage[dataobject] + return self.namestorage[dataobject] end end
tekkub/libdatabroker-1-1
7655ff9801c598afa9ad5a6f4a29c8d8edf80417
Allow caller to pass a pre-populated table to NewDataObject
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index 6b10124..3617bbe 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,50 +1,54 @@ assert(LibStub, "LibDataBroker-1.1 requires LibStub") assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") -local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) +local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 2) if not lib then return end +oldminor = oldminor or 0 lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, proxystorage = lib.attributestorage, lib.namestorage, lib.proxystorage local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end lib.callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } -function lib:NewDataObject(name) +function lib:NewDataObject(name, dataobj) if proxystorage[name] then return end - local dataobj = setmetatable({}, domt) + assert(type(dataobj) == "table" or type(dataobj) == "nil", "Invalid dataobj, must be nil or a table") + dataobj = setmetatable(dataobj or {}, self.domt) proxystorage[name], namestorage[dataobj] = dataobj, name lib.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end -function lib:DataObjectIterator() - return pairs(proxystorage) -end +if oldminor < 1 + function lib:DataObjectIterator() + return pairs(proxystorage) + end -function lib:GetDataObjectByName(dataobjectname) - return proxystorage[dataobjectname] -end + function lib:GetDataObjectByName(dataobjectname) + return proxystorage[dataobjectname] + end -function lib:GetNameByDataObject(dataobject) - return namestorage[dataobject] + function lib:GetNameByDataObject(dataobject) + return namestorage[dataobject] + end end
tekkub/libdatabroker-1-1
f9d04aca94f28ed089dc827bf4fd35921c2ea6d9
Add asserts to ensure our embedder has provided LibStub and CBH-1.0
diff --git a/LibDataBroker-1.1.lua b/LibDataBroker-1.1.lua index 636ab1e..6b10124 100644 --- a/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1.lua @@ -1,47 +1,50 @@ +assert(LibStub, "LibDataBroker-1.1 requires LibStub") +assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0") + local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) if not lib then return end lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, proxystorage = lib.attributestorage, lib.namestorage, lib.proxystorage local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end lib.callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject(name) if proxystorage[name] then return end local dataobj = setmetatable({}, domt) proxystorage[name], namestorage[dataobj] = dataobj, name lib.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
caa52c9091b238a937f9dd28097e8628ad790608
Add two more callbacks, so we can listen to all changes to all DOs, and for changes to a specific key across all DOs
diff --git a/LibDataBroker-1.1/LibDataBroker-1.1.lua b/LibDataBroker-1.1/LibDataBroker-1.1.lua index c033090..636ab1e 100644 --- a/LibDataBroker-1.1/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1/LibDataBroker-1.1.lua @@ -1,45 +1,47 @@ local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) if not lib then return end lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} local attributestorage, namestorage, proxystorage = lib.attributestorage, lib.namestorage, lib.proxystorage local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end + lib.callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) + lib.callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject(name) if proxystorage[name] then return end local dataobj = setmetatable({}, domt) proxystorage[name], namestorage[dataobj] = dataobj, name lib.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
890376564bf7237d7b28bcc6d88e5db1bfa03d29
Compact down some code
diff --git a/LibDataBroker-1.1/LibDataBroker-1.1.lua b/LibDataBroker-1.1/LibDataBroker-1.1.lua index f12e2b1..c033090 100644 --- a/LibDataBroker-1.1/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1/LibDataBroker-1.1.lua @@ -1,53 +1,45 @@ local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) if not lib then return end lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) - -lib.attributestorage = lib.attributestorage or {} -lib.namestorage = lib.namestorage or {} -lib.proxystorage = lib.proxystorage or {} - -local attributestorage = lib.attributestorage -local namestorage = lib.namestorage -local proxystorage = lib.proxystorage +lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {} +local attributestorage, namestorage, proxystorage = lib.attributestorage, lib.namestorage, lib.proxystorage local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject(name) if proxystorage[name] then return end local dataobj = setmetatable({}, domt) - - proxystorage[name] = dataobj - namestorage[dataobj] = name + proxystorage[name], namestorage[dataobj] = dataobj, name lib.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) return dataobj end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
1732e63c1063e07c93a7f3f039182be002fbdfbc
Simplify new/register into one function
diff --git a/LibDataBroker-1.1/LibDataBroker-1.1.lua b/LibDataBroker-1.1/LibDataBroker-1.1.lua index 7cee3e3..f12e2b1 100644 --- a/LibDataBroker-1.1/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1/LibDataBroker-1.1.lua @@ -1,56 +1,53 @@ local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) if not lib then return end lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage = lib.attributestorage or {} lib.namestorage = lib.namestorage or {} lib.proxystorage = lib.proxystorage or {} local attributestorage = lib.attributestorage local namestorage = lib.namestorage local proxystorage = lib.proxystorage local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } -function lib:NewDataObject() - return setmetatable({}, domt) -end +function lib:NewDataObject(name) + if proxystorage[name] then return end + + local dataobj = setmetatable({}, domt) -function lib:RegisterDataObject(dataobjectname, dataobject) - if not proxystorage[dataobjectname] then - proxystorage[dataobjectname] = dataobject - namestorage[dataobject] = dataobjectname - lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) - return true - end - return false + proxystorage[name] = dataobj + namestorage[dataobj] = name + lib.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj) + return dataobj end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
3f44478fe067a11ede0c3149a58ea52cb2629a82
Why do we not fire callbacks for specific keys?
diff --git a/LibDataBroker-1.1/LibDataBroker-1.1.lua b/LibDataBroker-1.1/LibDataBroker-1.1.lua index 608f480..7cee3e3 100644 --- a/LibDataBroker-1.1/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1/LibDataBroker-1.1.lua @@ -1,55 +1,56 @@ local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) if not lib then return end lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage = lib.attributestorage or {} lib.namestorage = lib.namestorage or {} lib.proxystorage = lib.proxystorage or {} local attributestorage = lib.attributestorage local namestorage = lib.namestorage local proxystorage = lib.proxystorage local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if not name then return end lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) + lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value) end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject() return setmetatable({}, domt) end function lib:RegisterDataObject(dataobjectname, dataobject) if not proxystorage[dataobjectname] then proxystorage[dataobjectname] = dataobject namestorage[dataobject] = dataobjectname lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) return true end return false end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
c95346bd06d59cb7a7cc822aed5311cf37e6bcf1
Clean up redundant code, see redundant
diff --git a/LibDataBroker-1.1/LibDataBroker-1.1.lua b/LibDataBroker-1.1/LibDataBroker-1.1.lua index 77b82a8..608f480 100644 --- a/LibDataBroker-1.1/LibDataBroker-1.1.lua +++ b/LibDataBroker-1.1/LibDataBroker-1.1.lua @@ -1,64 +1,55 @@ -local MAJOR, MINOR = "LibDataBroker-1.1", "$Revision$" -local lib = LibStub:NewLibrary(MAJOR, MINOR) - +local lib = LibStub:NewLibrary("LibDataBroker-1.1", 1) if not lib then return end -local _G = getfenv(0) -local setmetatable = _G.setmetatable - -local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") -lib.callbacks = lib.callbacks or CallbackHandler:New(lib) +lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib) lib.attributestorage = lib.attributestorage or {} lib.namestorage = lib.namestorage or {} lib.proxystorage = lib.proxystorage or {} local attributestorage = lib.attributestorage local namestorage = lib.namestorage local proxystorage = lib.proxystorage -local domt -domt = { +local domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] - if name then - lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) - end + if not name then return end + lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) end, __index = function(self, key) - return attributestorage[self] and attributestorage[self][key] or nil + return attributestorage[self] and attributestorage[self][key] end, } function lib:NewDataObject() - local dataobject = setmetatable({}, domt) - return dataobject + return setmetatable({}, domt) end function lib:RegisterDataObject(dataobjectname, dataobject) if not proxystorage[dataobjectname] then proxystorage[dataobjectname] = dataobject namestorage[dataobject] = dataobjectname lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) return true end return false end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
02eedf1d028c2eb203b4ced5017b754b8b3c70ea
Clean up Elky's retarded whitespace
diff --git a/LibDataBroker-1.0/LibDataBroker-1.0.lua b/LibDataBroker-1.0/LibDataBroker-1.0.lua index 5d83327..9ea6a83 100644 --- a/LibDataBroker-1.0/LibDataBroker-1.0.lua +++ b/LibDataBroker-1.0/LibDataBroker-1.0.lua @@ -1,74 +1,74 @@ --[[ Name: LibDataBroker-1.0 Revision: $Revision$ Author: Elkano ([email protected]) Website: http:// Documentation: http://www.wowace.com/wiki/LibDataBroker-1.0 SVN: http://svn.wowace.com/wowace/trunk/LibDataBroker-1.0/ Description: A central registry for addons looking for something to display their data. Dependencies: LibStub, CallbackHandler-1.0 ]] local MAJOR, MINOR = "LibDataBroker-1.0", "$Revision$" local lib = LibStub:NewLibrary(MAJOR, MINOR) if not lib then return end local _G = getfenv(0) local setmetatable = _G.setmetatable local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") -lib.callbacks = lib.callbacks or CallbackHandler:New(lib) +lib.callbacks = lib.callbacks or CallbackHandler:New(lib) -lib.attributestorage = lib.attributestorage or {} -lib.namestorage = lib.namestorage or {} -lib.proxystorage = lib.proxystorage or {} +lib.attributestorage = lib.attributestorage or {} +lib.namestorage = lib.namestorage or {} +lib.proxystorage = lib.proxystorage or {} -local attributestorage = lib.attributestorage -local namestorage = lib.namestorage -local proxystorage = lib.proxystorage +local attributestorage = lib.attributestorage +local namestorage = lib.namestorage +local proxystorage = lib.proxystorage local domt domt = { - __metatable = "access denied", - __newindex = function(self, key, value) - if not attributestorage[self] then attributestorage[self] = {} end - if attributestorage[self][key] == value then return end - attributestorage[self][key] = value - local name = namestorage[self] - if name then - lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) - end - end, - __index = function(self, key) - return attributestorage[self] and attributestorage[self][key] or nil - end, + __metatable = "access denied", + __newindex = function(self, key, value) + if not attributestorage[self] then attributestorage[self] = {} end + if attributestorage[self][key] == value then return end + attributestorage[self][key] = value + local name = namestorage[self] + if name then + lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) + end + end, + __index = function(self, key) + return attributestorage[self] and attributestorage[self][key] or nil + end, } function lib:NewDataObject() local dataobject = setmetatable({}, domt) return dataobject end function lib:RegisterDataObject(dataobjectname, dataobject) if not proxystorage[dataobjectname] then proxystorage[dataobjectname] = dataobject namestorage[dataobject] = dataobjectname lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) return true end return false end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end
tekkub/libdatabroker-1-1
bce535daf74fb27c8b18694ca603007634e1aa21
LibDataBroker-1.0: setting attribute to its current value wont fire AttributeChanged anymore
diff --git a/LibDataBroker-1.0/LibDataBroker-1.0.lua b/LibDataBroker-1.0/LibDataBroker-1.0.lua index 33a6159..5d83327 100644 --- a/LibDataBroker-1.0/LibDataBroker-1.0.lua +++ b/LibDataBroker-1.0/LibDataBroker-1.0.lua @@ -1,73 +1,74 @@ --[[ Name: LibDataBroker-1.0 Revision: $Revision$ Author: Elkano ([email protected]) Website: http:// Documentation: http://www.wowace.com/wiki/LibDataBroker-1.0 SVN: http://svn.wowace.com/wowace/trunk/LibDataBroker-1.0/ Description: A central registry for addons looking for something to display their data. Dependencies: LibStub, CallbackHandler-1.0 ]] local MAJOR, MINOR = "LibDataBroker-1.0", "$Revision$" local lib = LibStub:NewLibrary(MAJOR, MINOR) if not lib then return end local _G = getfenv(0) local setmetatable = _G.setmetatable local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") lib.callbacks = lib.callbacks or CallbackHandler:New(lib) lib.attributestorage = lib.attributestorage or {} lib.namestorage = lib.namestorage or {} lib.proxystorage = lib.proxystorage or {} local attributestorage = lib.attributestorage local namestorage = lib.namestorage local proxystorage = lib.proxystorage local domt domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end + if attributestorage[self][key] == value then return end attributestorage[self][key] = value local name = namestorage[self] if name then lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) end end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] or nil end, } function lib:NewDataObject() local dataobject = setmetatable({}, domt) return dataobject end function lib:RegisterDataObject(dataobjectname, dataobject) if not proxystorage[dataobjectname] then proxystorage[dataobjectname] = dataobject namestorage[dataobject] = dataobjectname lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) return true end return false end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end diff --git a/tests/LibDataBroker-1.0 tests.lua b/tests/LibDataBroker-1.0 tests.lua index 284d297..9e2daa5 100644 --- a/tests/LibDataBroker-1.0 tests.lua +++ b/tests/LibDataBroker-1.0 tests.lua @@ -1,76 +1,82 @@ dofile("wow_api.lua") dofile("../LibStub/LibStub.lua") dofile("../CallbackHandler-1.0/CallbackHandler-1.0.lua") dofile("../LibDataBroker-1.0/LibDataBroker-1.0.lua") local LDB = LibStub("LibDataBroker-1.0") local callback_result function callback_test(...) callback_result = {...} end local function dataobject_registered(callback, doname) LDB.RegisterCallback("test", "LibDataBroker_AttributeChanged_"..doname, callback_test) end LDB.RegisterCallback("test", "LibDataBroker_DataobjectRegistered", callback_test) LDB.RegisterCallback("test2", "LibDataBroker_DataobjectRegistered", dataobject_registered) -- creating new dataobject local dataobject = LDB:NewDataObject() assert(type(dataobject) == "table") -- unset attributes return nil assert(dataobject["test"] == nil) -- set attributes return value dataobject["test"] = 123 assert(dataobject["test"] == 123) -- registering fires callback callback_result = nil LDB:RegisterDataObject("testdo", dataobject) assert(callback_result[1] == "LibDataBroker_DataobjectRegistered" and callback_result[2] == "testdo" and callback_result[3] == dataobject) -- changing attribute of registered dataobject fires callback callback_result = nil dataobject["test"] = 456 assert(callback_result[1] == "LibDataBroker_AttributeChanged_testdo" and callback_result[2] == "testdo" and callback_result[3] == "test" and callback_result[4] == 456) assert(dataobject["test"] == 456) +-- set attribute of registered dataobject to its current value doesn't fire callback +callback_result = nil +dataobject["test"] = 456 +assert(callback_result == nil) +assert(dataobject["test"] == 456) + -- functions as attributes callback_result = nil local testfunc_result = nil dataobject.testfunc = function(self, ...) return {LDB:GetNameByDataObject(self), ...} end assert(callback_result[1] == "LibDataBroker_AttributeChanged_testdo" and callback_result[2] == "testdo" and callback_result[3] == "testfunc" and type(callback_result[4]) == "function") testfunc_result = dataobject:testfunc("testdata") assert(testfunc_result[1] == "testdo" and testfunc_result[2] == "testdata") -- data objects are independant local dataobject2 = LDB:NewDataObject() assert(type(dataobject2) == "table" and dataobject2 ~= dataobject) callback_result = nil LDB:RegisterDataObject("testdo2", dataobject2) assert(callback_result[1] == "LibDataBroker_DataobjectRegistered" and callback_result[2] == "testdo2" and callback_result[3] == dataobject2) callback_result = nil dataobject2["test"] = "abc" assert(callback_result[1] == "LibDataBroker_AttributeChanged_testdo2" and callback_result[2] == "testdo2" and callback_result[3] == "test" and callback_result[4] == "abc") assert(dataobject2["test"] == "abc") assert(dataobject["test"] == 456) -- LDB:GetDataObjectByName assert(LDB:GetDataObjectByName("testdo") == dataobject) assert(LDB:GetDataObjectByName("testdo2") == dataobject2) -- LDB:GetNameByDataObject assert(LDB:GetNameByDataObject(dataobject) == "testdo") assert(LDB:GetNameByDataObject(dataobject2) == "testdo2") -- LDB::DataObjectIterator for k, v in LDB:DataObjectIterator() do assert(LDB:GetDataObjectByName(k) == v) end print("OK") \ No newline at end of file
tekkub/libdatabroker-1-1
e4255aac77c5e244abecf0669d1078fd169efd96
LibDataBroker-1.0: moved the test file in here
diff --git a/tests/LibDataBroker-1.0 tests.lua b/tests/LibDataBroker-1.0 tests.lua new file mode 100644 index 0000000..284d297 --- /dev/null +++ b/tests/LibDataBroker-1.0 tests.lua @@ -0,0 +1,76 @@ +dofile("wow_api.lua") +dofile("../LibStub/LibStub.lua") +dofile("../CallbackHandler-1.0/CallbackHandler-1.0.lua") +dofile("../LibDataBroker-1.0/LibDataBroker-1.0.lua") + +local LDB = LibStub("LibDataBroker-1.0") + +local callback_result +function callback_test(...) + callback_result = {...} +end + +local function dataobject_registered(callback, doname) + LDB.RegisterCallback("test", "LibDataBroker_AttributeChanged_"..doname, callback_test) +end + +LDB.RegisterCallback("test", "LibDataBroker_DataobjectRegistered", callback_test) +LDB.RegisterCallback("test2", "LibDataBroker_DataobjectRegistered", dataobject_registered) + +-- creating new dataobject +local dataobject = LDB:NewDataObject() +assert(type(dataobject) == "table") + +-- unset attributes return nil +assert(dataobject["test"] == nil) + +-- set attributes return value +dataobject["test"] = 123 +assert(dataobject["test"] == 123) + +-- registering fires callback +callback_result = nil +LDB:RegisterDataObject("testdo", dataobject) +assert(callback_result[1] == "LibDataBroker_DataobjectRegistered" and callback_result[2] == "testdo" and callback_result[3] == dataobject) + +-- changing attribute of registered dataobject fires callback +callback_result = nil +dataobject["test"] = 456 +assert(callback_result[1] == "LibDataBroker_AttributeChanged_testdo" and callback_result[2] == "testdo" and callback_result[3] == "test" and callback_result[4] == 456) +assert(dataobject["test"] == 456) + +-- functions as attributes +callback_result = nil +local testfunc_result = nil +dataobject.testfunc = function(self, ...) return {LDB:GetNameByDataObject(self), ...} end +assert(callback_result[1] == "LibDataBroker_AttributeChanged_testdo" and callback_result[2] == "testdo" and callback_result[3] == "testfunc" and type(callback_result[4]) == "function") + +testfunc_result = dataobject:testfunc("testdata") +assert(testfunc_result[1] == "testdo" and testfunc_result[2] == "testdata") + +-- data objects are independant +local dataobject2 = LDB:NewDataObject() +assert(type(dataobject2) == "table" and dataobject2 ~= dataobject) +callback_result = nil +LDB:RegisterDataObject("testdo2", dataobject2) +assert(callback_result[1] == "LibDataBroker_DataobjectRegistered" and callback_result[2] == "testdo2" and callback_result[3] == dataobject2) +callback_result = nil +dataobject2["test"] = "abc" +assert(callback_result[1] == "LibDataBroker_AttributeChanged_testdo2" and callback_result[2] == "testdo2" and callback_result[3] == "test" and callback_result[4] == "abc") +assert(dataobject2["test"] == "abc") +assert(dataobject["test"] == 456) + +-- LDB:GetDataObjectByName +assert(LDB:GetDataObjectByName("testdo") == dataobject) +assert(LDB:GetDataObjectByName("testdo2") == dataobject2) + +-- LDB:GetNameByDataObject +assert(LDB:GetNameByDataObject(dataobject) == "testdo") +assert(LDB:GetNameByDataObject(dataobject2) == "testdo2") + +-- LDB::DataObjectIterator +for k, v in LDB:DataObjectIterator() do + assert(LDB:GetDataObjectByName(k) == v) +end + +print("OK") \ No newline at end of file diff --git a/tests/wow_api.lua b/tests/wow_api.lua new file mode 100644 index 0000000..f32e16d --- /dev/null +++ b/tests/wow_api.lua @@ -0,0 +1,252 @@ +local _G = getfenv(0) + +local donothing = function() end + +local frames = {} -- Stores globally created frames, and their internal properties. + +local FrameClass = {} -- A class for creating frames. +FrameClass.methods = { "SetScript", "RegisterEvent", "UnregisterEvent", "UnregisterAllEvents", "Show", "Hide", "IsShown" } +function FrameClass:New() + local frame = {} + for i,method in ipairs(self.methods) do + frame[method] = self[method] + end + local frameProps = { + events = {}, + scripts = {}, + timer = GetTime(), + isShow = true + } + return frame, frameProps +end +function FrameClass:SetScript(script,handler) + frames[self].scripts[script] = handler +end +function FrameClass:RegisterEvent(event) + frames[self].events[event] = true +end +function FrameClass:UnregisterEvent(event) + frames[self].events[event] = nil +end +function FrameClass:UnregisterAllEvents(frame) + for event in pairs(frames[self].events) do + frames[self].events[event] = nil + end +end +function FrameClass:Show() + frames[self].isShow = true +end +function FrameClass:Hide() + frames[self].isShow = false +end +function FrameClass:IsShown() + return frames[self].isShow +end + + + +function CreateFrame(kind, name, parent) + local frame,internal = FrameClass:New() + frames[frame] = internal + if name then + _G[name] = frame + end + return frame +end + +function UnitName(unit) + return unit +end + +function GetRealmName() + return "Realm Name" +end + +function UnitClass(unit) + return "Warrior", "WARRIOR" +end + +function UnitHealthMax() + return 100 +end + +function UnitHealth() + return 50 +end + +function GetNumRaidMembers() + return 1 +end + +function GetNumPartyMembers() + return 1 +end + +FACTION_HORDE = "Horde" +FACTION_ALLIANCE = "Alliance" + +function UnitFactionGroup(unit) + return "Horde", "Horde" +end + +function UnitRace(unit) + return "Undead", "Scourge" +end + + +_time = 0 +function GetTime() + return _time +end + +function IsAddOnLoaded() return nil end + +SlashCmdList = {} + +function __WOW_Input(text) + local a,b = string.find(text, "^/%w+") + local arg, text = string.sub(text, a,b), string.sub(text, b + 2) + for k,handler in pairs(SlashCmdList) do + local i = 0 + while true do + i = i + 1 + if not _G["SLASH_" .. k .. i] then + break + elseif _G["SLASH_" .. k .. i] == arg then + handler(text) + return + end + end + end; + print("No command found:", text) +end + +local ChatFrameTemplate = { + AddMessage = function(self, text) + print((string.gsub(text, "|c%x%x%x%x%x%x%x%x(.-)|r", "%1"))) + end +} + +for i=1,7 do + local f = {} + for k,v in pairs(ChatFrameTemplate) do + f[k] = v + end + _G["ChatFrame"..i] = f +end +DEFAULT_CHAT_FRAME = ChatFrame1 + +debugstack = debug.traceback +date = os.date + +function GetLocale() + return "enUS" +end + +function GetAddOnInfo() + return +end + +function GetNumAddOns() + return 0 +end + +function getglobal(k) + return _G[k] +end + +function setglobal(k, v) + _G[k] = v +end + +local function _errorhandler(msg) + print("--------- geterrorhandler error -------\n"..msg.."\n-----end error-----\n") +end + +function geterrorhandler() + return _errorhandler +end + +function InCombatLockdown() + return false +end + +function IsLoggedIn() + return false +end + +function GetFramerate() + return 60 +end + +time = os.clock + +strmatch = string.match + +function SendAddonMessage(prefix, message, distribution, target) + assert(#prefix + #message < 255, + string.format("SendAddonMessage: message too long (%d bytes)", + #prefix + #message)) + -- CHAT_MSG_ADDON(prefix, message, distribution, sender) + WoWAPI_FireEvent("CHAT_MSG_ADDON", prefix, message, distribution, "Sender") +end + +function hooksecurefunc(func_name, post_hook_func) + local orig_func = _G[func_name] + + _G[func_name] = function (...) + local ret = { orig_func(...) } -- yeahyeah wasteful, see if i care, it's a test framework + post_hook_func(...) + return unpack(ret) + end +end + +RED_FONT_COLOR_CODE = "" +GREEN_FONT_COLOR_CODE = "" + +StaticPopupDialogs = {} + +function WoWAPI_FireEvent(event,...) + for frame, props in pairs(frames) do + if props.events[event] then + if props.scripts["OnEvent"] then + for i=1,select('#',...) do + _G["arg"..i] = select(i,...) + end + _G.event=event + props.scripts["OnEvent"](frame,event,...) + end + end + end +end + +function WoWAPI_FireUpdate(forceNow) + if forceNow then + _time = forceNow + end + local now = GetTime() + for frame,props in pairs(frames) do + if props.isShow and props.scripts.OnUpdate then + _G.arg1=now-props.timer + props.scripts.OnUpdate(frame,now-props.timer) + props.timer = now + end + end +end + + + + +-- utility function for "dumping" a number of arguments (return a string representation of them) +function dump(...) + local t = {} + for i=1,select("#", ...) do + local v = select(i, ...) + if type(v)=="string" then + tinsert(t, string.format("%q", v)) + else + tinsert(t, tostring(v)) + end + end + return "<"..table.concat(t, "> <")..">" +end
tekkub/libdatabroker-1-1
13d98defda2a6a438cc422e2d18adea036030062
LibDataBroker-1.0: - readded LS and CBH - pushed TOC - changed directory structure for better embedding - added Revision keyword to lua file
diff --git a/CallbackHandler-1.0/CallbackHandler-1.0.lua b/CallbackHandler-1.0/CallbackHandler-1.0.lua new file mode 100644 index 0000000..5ad658f --- /dev/null +++ b/CallbackHandler-1.0/CallbackHandler-1.0.lua @@ -0,0 +1,239 @@ +--[[ $Id: CallbackHandler-1.0.lua 60548 2008-02-07 11:04:06Z nevcairiel $ ]] +local MAJOR, MINOR = "CallbackHandler-1.0", 3 +local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) + +if not CallbackHandler then return end -- No upgrade needed + +local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} + +local type = type +local pcall = pcall +local pairs = pairs +local assert = assert +local concat = table.concat +local loadstring = loadstring +local next = next +local select = select +local type = type +local xpcall = xpcall + +local function errorhandler(err) + return geterrorhandler()(err) +end + +local function CreateDispatcher(argCount) + local code = [[ + local next, xpcall, eh = ... + + local method, ARGS + local function call() method(ARGS) end + + local function dispatch(handlers, ...) + local index + index, method = next(handlers) + if not method then return end + local OLD_ARGS = ARGS + ARGS = ... + repeat + xpcall(call, eh) + index, method = next(handlers, index) + until not method + ARGS = OLD_ARGS + end + + return dispatch + ]] + + local ARGS, OLD_ARGS = {}, {} + for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end + code = code:gsub("OLD_ARGS", concat(OLD_ARGS, ", ")):gsub("ARGS", concat(ARGS, ", ")) + return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler) +end + +local Dispatchers = setmetatable({}, {__index=function(self, argCount) + local dispatcher = CreateDispatcher(argCount) + rawset(self, argCount, dispatcher) + return dispatcher +end}) + +-------------------------------------------------------------------------- +-- CallbackHandler:New +-- +-- target - target object to embed public APIs in +-- RegisterName - name of the callback registration API, default "RegisterCallback" +-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" +-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. + +function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused) + -- TODO: Remove this after beta has gone out + assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused") + + RegisterName = RegisterName or "RegisterCallback" + UnregisterName = UnregisterName or "UnregisterCallback" + if UnregisterAllName==nil then -- false is used to indicate "don't want this method" + UnregisterAllName = "UnregisterAllCallbacks" + end + + -- we declare all objects and exported APIs inside this closure to quickly gain access + -- to e.g. function names, the "target" parameter, etc + + + -- Create the registry object + local events = setmetatable({}, meta) + local registry = { recurse=0, events=events } + + -- registry:Fire() - fires the given event/message into the registry + function registry:Fire(eventname, ...) + if not rawget(events, eventname) or not next(events[eventname]) then return end + local oldrecurse = registry.recurse + registry.recurse = oldrecurse + 1 + + Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...) + + registry.recurse = oldrecurse + + if registry.insertQueue and oldrecurse==0 then + -- Something in one of our callbacks wanted to register more callbacks; they got queued + for eventname,callbacks in pairs(registry.insertQueue) do + local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. + for self,func in pairs(callbacks) do + events[eventname][self] = func + -- fire OnUsed callback? + if first and registry.OnUsed then + registry.OnUsed(registry, target, eventname) + first = nil + end + end + end + registry.insertQueue = nil + end + end + + -- Registration of a callback, handles: + -- self["method"], leads to self["method"](self, ...) + -- self with function ref, leads to functionref(...) + -- "addonId" (instead of self) with function ref, leads to functionref(...) + -- all with an optional arg, which, if present, gets passed as first argument (after self if present) + target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]]) + if type(eventname) ~= "string" then + error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2) + end + + method = method or eventname + + local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. + + if type(method) ~= "string" and type(method) ~= "function" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2) + end + + local regfunc + + if type(method) == "string" then + -- self["method"] calling style + if type(self) ~= "table" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2) + elseif self==target then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2) + elseif type(self[method]) ~= "function" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2) + end + + if select("#",...)>=1 then -- this is not the same as testing for arg==nil! + local arg=select(1,...) + regfunc = function(...) self[method](self,arg,...) end + else + regfunc = function(...) self[method](self,...) end + end + else + -- function ref with self=object or self="addonId" + if type(self)~="table" and type(self)~="string" then + error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string expected.", 2) + end + + if select("#",...)>=1 then -- this is not the same as testing for arg==nil! + local arg=select(1,...) + regfunc = function(...) method(arg,...) end + else + regfunc = method + end + end + + + if events[eventname][self] or registry.recurse<1 then + -- if registry.recurse<1 then + -- we're overwriting an existing entry, or not currently recursing. just set it. + events[eventname][self] = regfunc + -- fire OnUsed callback? + if registry.OnUsed and first then + registry.OnUsed(registry, target, eventname) + end + else + -- we're currently processing a callback in this registry, so delay the registration of this new entry! + -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency + registry.insertQueue = registry.insertQueue or setmetatable({},meta) + registry.insertQueue[eventname][self] = regfunc + end + end + + -- Unregister a callback + target[UnregisterName] = function(self, eventname) + if not self or self==target then + error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2) + end + if type(eventname) ~= "string" then + error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2) + end + if rawget(events, eventname) and events[eventname][self] then + events[eventname][self] = nil + -- Fire OnUnused callback? + if registry.OnUnused and not next(events[eventname]) then + registry.OnUnused(registry, target, eventname) + end + end + if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then + registry.insertQueue[eventname][self] = nil + end + end + + -- OPTIONAL: Unregister all callbacks for given selfs/addonIds + if UnregisterAllName then + target[UnregisterAllName] = function(...) + if select("#",...)<1 then + error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2) + end + if select("#",...)==1 and ...==target then + error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2) + end + + + for i=1,select("#",...) do + local self = select(i,...) + if registry.insertQueue then + for eventname, callbacks in pairs(registry.insertQueue) do + if callbacks[self] then + callbacks[self] = nil + end + end + end + for eventname, callbacks in pairs(events) do + if callbacks[self] then + callbacks[self] = nil + -- Fire OnUnused callback? + if registry.OnUnused and not next(callbacks) then + registry.OnUnused(registry, target, eventname) + end + end + end + end + end + end + + return registry +end + + +-- CallbackHandler purposefully does NOT do explicit embedding. Nor does it +-- try to upgrade old implicit embeds since the system is selfcontained and +-- relies on closures to work. + diff --git a/LibDataBroker-1.0.toc b/LibDataBroker-1.0.toc index ec4773a..0e83abd 100644 --- a/LibDataBroker-1.0.toc +++ b/LibDataBroker-1.0.toc @@ -1,14 +1,14 @@ -## Interface: 20300 +## Interface: 20400 ## Title: Lib: DataBroker-1.0 ## Notes: A central registry for addons looking for something to display their data. ## Version: 1.0 ## Author: Elkano ## X-Category: Library ## LoadOnDemand: 1 -LibStub/LibStub.lua -CallbackHandler-1.0/CallbackHandler-1.0.lua +LibStub\LibStub.lua +CallbackHandler-1.0\CallbackHandler-1.0.lua -lib.xml +LibDataBroker-1.0\lib.xml diff --git a/LibDataBroker-1.0.lua b/LibDataBroker-1.0/LibDataBroker-1.0.lua similarity index 95% rename from LibDataBroker-1.0.lua rename to LibDataBroker-1.0/LibDataBroker-1.0.lua index 0fa7d3e..33a6159 100644 --- a/LibDataBroker-1.0.lua +++ b/LibDataBroker-1.0/LibDataBroker-1.0.lua @@ -1,73 +1,73 @@ --[[ Name: LibDataBroker-1.0 -Revision: $Revision: 0 $ +Revision: $Revision$ Author: Elkano ([email protected]) Website: http:// Documentation: http://www.wowace.com/wiki/LibDataBroker-1.0 SVN: http://svn.wowace.com/wowace/trunk/LibDataBroker-1.0/ Description: A central registry for addons looking for something to display their data. Dependencies: LibStub, CallbackHandler-1.0 ]] -local MAJOR, MINOR = "LibDataBroker-1.0", "$Revision: 0 $" +local MAJOR, MINOR = "LibDataBroker-1.0", "$Revision$" local lib = LibStub:NewLibrary(MAJOR, MINOR) if not lib then return end local _G = getfenv(0) local setmetatable = _G.setmetatable local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") lib.callbacks = lib.callbacks or CallbackHandler:New(lib) lib.attributestorage = lib.attributestorage or {} lib.namestorage = lib.namestorage or {} lib.proxystorage = lib.proxystorage or {} local attributestorage = lib.attributestorage local namestorage = lib.namestorage local proxystorage = lib.proxystorage local domt domt = { __metatable = "access denied", __newindex = function(self, key, value) if not attributestorage[self] then attributestorage[self] = {} end attributestorage[self][key] = value local name = namestorage[self] if name then lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) end end, __index = function(self, key) return attributestorage[self] and attributestorage[self][key] or nil end, } function lib:NewDataObject() local dataobject = setmetatable({}, domt) return dataobject end function lib:RegisterDataObject(dataobjectname, dataobject) if not proxystorage[dataobjectname] then proxystorage[dataobjectname] = dataobject namestorage[dataobject] = dataobjectname lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) return true end return false end function lib:DataObjectIterator() return pairs(proxystorage) end function lib:GetDataObjectByName(dataobjectname) return proxystorage[dataobjectname] end function lib:GetNameByDataObject(dataobject) return namestorage[dataobject] end diff --git a/LibDataBroker-1.0/lib.xml b/LibDataBroker-1.0/lib.xml new file mode 100644 index 0000000..209b0e5 --- /dev/null +++ b/LibDataBroker-1.0/lib.xml @@ -0,0 +1,4 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + <Script file="LibDataBroker-1.0.lua" /> +</Ui> \ No newline at end of file diff --git a/LibStub/LibStub.lua b/LibStub/LibStub.lua new file mode 100644 index 0000000..0a41ac0 --- /dev/null +++ b/LibStub/LibStub.lua @@ -0,0 +1,30 @@ +-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info +-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke +local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! +local LibStub = _G[LIBSTUB_MAJOR] + +if not LibStub or LibStub.minor < LIBSTUB_MINOR then + LibStub = LibStub or {libs = {}, minors = {} } + _G[LIBSTUB_MAJOR] = LibStub + LibStub.minor = LIBSTUB_MINOR + + function LibStub:NewLibrary(major, minor) + assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") + minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") + + local oldminor = self.minors[major] + if oldminor and oldminor >= minor then return nil end + self.minors[major], self.libs[major] = minor, self.libs[major] or {} + return self.libs[major], oldminor + end + + function LibStub:GetLibrary(major, silent) + if not self.libs[major] and not silent then + error(("Cannot find a library instance of %q."):format(tostring(major)), 2) + end + return self.libs[major], self.minors[major] + end + + function LibStub:IterateLibraries() return pairs(self.libs) end + setmetatable(LibStub, { __call = LibStub.GetLibrary }) +end diff --git a/lib.xml b/lib.xml index 209b0e5..de28c02 100644 --- a/lib.xml +++ b/lib.xml @@ -1,4 +1,4 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> - <Script file="LibDataBroker-1.0.lua" /> + <Script file="LibDataBroker-1.0\LibDataBroker-1.0.lua" /> </Ui> \ No newline at end of file
tekkub/libdatabroker-1-1
4718396dc8a209d644375d7f25a718ae91a2c585
LibDataBroker-1.0: initial push to SVN
diff --git a/CallbackHandler-1.0/CallbackHandler-1.0.lua b/CallbackHandler-1.0/CallbackHandler-1.0.lua new file mode 100644 index 0000000..5ad658f --- /dev/null +++ b/CallbackHandler-1.0/CallbackHandler-1.0.lua @@ -0,0 +1,239 @@ +--[[ $Id: CallbackHandler-1.0.lua 60548 2008-02-07 11:04:06Z nevcairiel $ ]] +local MAJOR, MINOR = "CallbackHandler-1.0", 3 +local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR) + +if not CallbackHandler then return end -- No upgrade needed + +local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end} + +local type = type +local pcall = pcall +local pairs = pairs +local assert = assert +local concat = table.concat +local loadstring = loadstring +local next = next +local select = select +local type = type +local xpcall = xpcall + +local function errorhandler(err) + return geterrorhandler()(err) +end + +local function CreateDispatcher(argCount) + local code = [[ + local next, xpcall, eh = ... + + local method, ARGS + local function call() method(ARGS) end + + local function dispatch(handlers, ...) + local index + index, method = next(handlers) + if not method then return end + local OLD_ARGS = ARGS + ARGS = ... + repeat + xpcall(call, eh) + index, method = next(handlers, index) + until not method + ARGS = OLD_ARGS + end + + return dispatch + ]] + + local ARGS, OLD_ARGS = {}, {} + for i = 1, argCount do ARGS[i], OLD_ARGS[i] = "arg"..i, "old_arg"..i end + code = code:gsub("OLD_ARGS", concat(OLD_ARGS, ", ")):gsub("ARGS", concat(ARGS, ", ")) + return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(next, xpcall, errorhandler) +end + +local Dispatchers = setmetatable({}, {__index=function(self, argCount) + local dispatcher = CreateDispatcher(argCount) + rawset(self, argCount, dispatcher) + return dispatcher +end}) + +-------------------------------------------------------------------------- +-- CallbackHandler:New +-- +-- target - target object to embed public APIs in +-- RegisterName - name of the callback registration API, default "RegisterCallback" +-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback" +-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API. + +function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName, OnUsed, OnUnused) + -- TODO: Remove this after beta has gone out + assert(not OnUsed and not OnUnused, "ACE-80: OnUsed/OnUnused are deprecated. Callbacks are now done to registry.OnUsed and registry.OnUnused") + + RegisterName = RegisterName or "RegisterCallback" + UnregisterName = UnregisterName or "UnregisterCallback" + if UnregisterAllName==nil then -- false is used to indicate "don't want this method" + UnregisterAllName = "UnregisterAllCallbacks" + end + + -- we declare all objects and exported APIs inside this closure to quickly gain access + -- to e.g. function names, the "target" parameter, etc + + + -- Create the registry object + local events = setmetatable({}, meta) + local registry = { recurse=0, events=events } + + -- registry:Fire() - fires the given event/message into the registry + function registry:Fire(eventname, ...) + if not rawget(events, eventname) or not next(events[eventname]) then return end + local oldrecurse = registry.recurse + registry.recurse = oldrecurse + 1 + + Dispatchers[select('#', ...) + 1](events[eventname], eventname, ...) + + registry.recurse = oldrecurse + + if registry.insertQueue and oldrecurse==0 then + -- Something in one of our callbacks wanted to register more callbacks; they got queued + for eventname,callbacks in pairs(registry.insertQueue) do + local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. + for self,func in pairs(callbacks) do + events[eventname][self] = func + -- fire OnUsed callback? + if first and registry.OnUsed then + registry.OnUsed(registry, target, eventname) + first = nil + end + end + end + registry.insertQueue = nil + end + end + + -- Registration of a callback, handles: + -- self["method"], leads to self["method"](self, ...) + -- self with function ref, leads to functionref(...) + -- "addonId" (instead of self) with function ref, leads to functionref(...) + -- all with an optional arg, which, if present, gets passed as first argument (after self if present) + target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]]) + if type(eventname) ~= "string" then + error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2) + end + + method = method or eventname + + local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten. + + if type(method) ~= "string" and type(method) ~= "function" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2) + end + + local regfunc + + if type(method) == "string" then + -- self["method"] calling style + if type(self) ~= "table" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2) + elseif self==target then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2) + elseif type(self[method]) ~= "function" then + error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2) + end + + if select("#",...)>=1 then -- this is not the same as testing for arg==nil! + local arg=select(1,...) + regfunc = function(...) self[method](self,arg,...) end + else + regfunc = function(...) self[method](self,...) end + end + else + -- function ref with self=object or self="addonId" + if type(self)~="table" and type(self)~="string" then + error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string expected.", 2) + end + + if select("#",...)>=1 then -- this is not the same as testing for arg==nil! + local arg=select(1,...) + regfunc = function(...) method(arg,...) end + else + regfunc = method + end + end + + + if events[eventname][self] or registry.recurse<1 then + -- if registry.recurse<1 then + -- we're overwriting an existing entry, or not currently recursing. just set it. + events[eventname][self] = regfunc + -- fire OnUsed callback? + if registry.OnUsed and first then + registry.OnUsed(registry, target, eventname) + end + else + -- we're currently processing a callback in this registry, so delay the registration of this new entry! + -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency + registry.insertQueue = registry.insertQueue or setmetatable({},meta) + registry.insertQueue[eventname][self] = regfunc + end + end + + -- Unregister a callback + target[UnregisterName] = function(self, eventname) + if not self or self==target then + error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2) + end + if type(eventname) ~= "string" then + error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2) + end + if rawget(events, eventname) and events[eventname][self] then + events[eventname][self] = nil + -- Fire OnUnused callback? + if registry.OnUnused and not next(events[eventname]) then + registry.OnUnused(registry, target, eventname) + end + end + if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then + registry.insertQueue[eventname][self] = nil + end + end + + -- OPTIONAL: Unregister all callbacks for given selfs/addonIds + if UnregisterAllName then + target[UnregisterAllName] = function(...) + if select("#",...)<1 then + error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2) + end + if select("#",...)==1 and ...==target then + error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2) + end + + + for i=1,select("#",...) do + local self = select(i,...) + if registry.insertQueue then + for eventname, callbacks in pairs(registry.insertQueue) do + if callbacks[self] then + callbacks[self] = nil + end + end + end + for eventname, callbacks in pairs(events) do + if callbacks[self] then + callbacks[self] = nil + -- Fire OnUnused callback? + if registry.OnUnused and not next(callbacks) then + registry.OnUnused(registry, target, eventname) + end + end + end + end + end + end + + return registry +end + + +-- CallbackHandler purposefully does NOT do explicit embedding. Nor does it +-- try to upgrade old implicit embeds since the system is selfcontained and +-- relies on closures to work. + diff --git a/LibDataBroker-1.0.lua b/LibDataBroker-1.0.lua new file mode 100644 index 0000000..0fa7d3e --- /dev/null +++ b/LibDataBroker-1.0.lua @@ -0,0 +1,73 @@ +--[[ +Name: LibDataBroker-1.0 +Revision: $Revision: 0 $ +Author: Elkano ([email protected]) +Website: http:// +Documentation: http://www.wowace.com/wiki/LibDataBroker-1.0 +SVN: http://svn.wowace.com/wowace/trunk/LibDataBroker-1.0/ +Description: A central registry for addons looking for something to display their data. +Dependencies: LibStub, CallbackHandler-1.0 +]] + +local MAJOR, MINOR = "LibDataBroker-1.0", "$Revision: 0 $" +local lib = LibStub:NewLibrary(MAJOR, MINOR) + +if not lib then return end + +local _G = getfenv(0) +local setmetatable = _G.setmetatable + +local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") + +lib.callbacks = lib.callbacks or CallbackHandler:New(lib) + +lib.attributestorage = lib.attributestorage or {} +lib.namestorage = lib.namestorage or {} +lib.proxystorage = lib.proxystorage or {} + +local attributestorage = lib.attributestorage +local namestorage = lib.namestorage +local proxystorage = lib.proxystorage + +local domt +domt = { + __metatable = "access denied", + __newindex = function(self, key, value) + if not attributestorage[self] then attributestorage[self] = {} end + attributestorage[self][key] = value + local name = namestorage[self] + if name then + lib.callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value) + end + end, + __index = function(self, key) + return attributestorage[self] and attributestorage[self][key] or nil + end, +} + +function lib:NewDataObject() + local dataobject = setmetatable({}, domt) + return dataobject +end + +function lib:RegisterDataObject(dataobjectname, dataobject) + if not proxystorage[dataobjectname] then + proxystorage[dataobjectname] = dataobject + namestorage[dataobject] = dataobjectname + lib.callbacks:Fire("LibDataBroker_DataobjectRegistered", dataobjectname, dataobject) + return true + end + return false +end + +function lib:DataObjectIterator() + return pairs(proxystorage) +end + +function lib:GetDataObjectByName(dataobjectname) + return proxystorage[dataobjectname] +end + +function lib:GetNameByDataObject(dataobject) + return namestorage[dataobject] +end diff --git a/LibDataBroker-1.0.toc b/LibDataBroker-1.0.toc new file mode 100644 index 0000000..ec4773a --- /dev/null +++ b/LibDataBroker-1.0.toc @@ -0,0 +1,14 @@ +## Interface: 20300 + +## Title: Lib: DataBroker-1.0 +## Notes: A central registry for addons looking for something to display their data. +## Version: 1.0 +## Author: Elkano +## X-Category: Library + +## LoadOnDemand: 1 + +LibStub/LibStub.lua +CallbackHandler-1.0/CallbackHandler-1.0.lua + +lib.xml diff --git a/LibStub/LibStub.lua b/LibStub/LibStub.lua new file mode 100644 index 0000000..0a41ac0 --- /dev/null +++ b/LibStub/LibStub.lua @@ -0,0 +1,30 @@ +-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info +-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke +local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! +local LibStub = _G[LIBSTUB_MAJOR] + +if not LibStub or LibStub.minor < LIBSTUB_MINOR then + LibStub = LibStub or {libs = {}, minors = {} } + _G[LIBSTUB_MAJOR] = LibStub + LibStub.minor = LIBSTUB_MINOR + + function LibStub:NewLibrary(major, minor) + assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") + minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") + + local oldminor = self.minors[major] + if oldminor and oldminor >= minor then return nil end + self.minors[major], self.libs[major] = minor, self.libs[major] or {} + return self.libs[major], oldminor + end + + function LibStub:GetLibrary(major, silent) + if not self.libs[major] and not silent then + error(("Cannot find a library instance of %q."):format(tostring(major)), 2) + end + return self.libs[major], self.minors[major] + end + + function LibStub:IterateLibraries() return pairs(self.libs) end + setmetatable(LibStub, { __call = LibStub.GetLibrary }) +end diff --git a/lib.xml b/lib.xml new file mode 100644 index 0000000..209b0e5 --- /dev/null +++ b/lib.xml @@ -0,0 +1,4 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ +..\FrameXML\UI.xsd"> + <Script file="LibDataBroker-1.0.lua" /> +</Ui> \ No newline at end of file
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
4a70b42262066480c74cd0099960f3d6f0eba72f
Allows the user to pass the REMOTE_ADDR via the params hash
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index c5cd597..1381144 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,240 +1,249 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; +use Carp; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.04'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); -has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); sub _build_public_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_public_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'public_key' field option or defined a $method method in your form!"; } } sub _build_private_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_private_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'private_key' field option or defined a $method method in your form!"; } } sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } -sub _build_remote_address { - $ENV{REMOTE_ADDR}; +sub remote_address { + my $self = shift @_; + + my $remote_addr = $self->form->params->{REMOTE_ADDR} || $ENV{REMOTE_ADDR}; + croak 'REMOTE_ADDR must be set in the params hash for process()' . + 'or in $ENV{REMOTE_ADDR}.' unless $remote_addr; + + return $remote_addr; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost. Please try again."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandlerX::Field::reCAPTCHA - A Captcha::reCAPTCHA field for HTML::FormHandler =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example L<Catalyst> controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; + ## REMOTE_ADDR must be passed with params + ## or available in $ENV{REMOTE_ADDR} + $params->{REMOTE_ADDR} = $c->req->address; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from L<http://recaptcha.net/> to make this work. This is a thin wrapper on top of L<Captcha::reCAPTCHA> so you should review the docs for that. However there's not much too it, just register for an account over at L<http://recaptcha.net> and use it. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on L<http://recaptcha.net/> =head2 private_key The private key you get when you create an account on L<http://recaptcha.net/> =head2 use_ssl control the 'use_ssl' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_options control the 'options' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_message What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. This error message is in addition to any other constraints you add, such as 'required'. Please note that the recaptcha control also displays an error message internal to itself. =head1 FORM METHODS The following methods or attributes can be set in the form which contains the recapcha field. =head2 $name_public_key or $name_private_key "$name" is the name you gave to the reCAPTCHA field (the word directy after the "has_field" command. You may wish to set your public key from a method or attribute contained from within the form. This would make it easier to have one form class and use configuration tools, such as what L<Catalyst> offers, to set the pubic key. For example: ## In my form "MyApp::Form::MyForm has ['MY_recaptcha_public_key', 'MY_recapcha_private_key'] => ( is=>'ro', isa=>'Str', required=>1, ); has_field 'MY_recaptcha' => ( type=>'reCAPTCHA', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Then you might construct this in a L<Catalyst::Controller>: my $form = MyApp::Form::MyForm->new( MY_recaptcha_public_key => $self->controller_public_key, MY_recaptcha_private_key => $self->controller_private_key, ); ## 'process', etc. Then your controller could populate the attributes 'controller_public_key' and 'controller_private_key' from your global L<Catalyst> configuration, allowing you to use one set of keys in development and another for production, or even use different keys for different forms if you wish. =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 CONTRIBUTORS Ferruccio Zamuner (ferz) =head1 COPYRIGHT & LICENSE Copyright 2013, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. L<http://shutterstock.com> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
e633908c8d7c9cdbfe6d2994ac57a049f6af4393
new failing test?
diff --git a/t/recaptcha_field.t b/t/recaptcha_field.t index 85a2dcd..446bb8b 100644 --- a/t/recaptcha_field.t +++ b/t/recaptcha_field.t @@ -1,62 +1,79 @@ #/usr/bin/env perl use strict; use warnings; use Test::More tests=>4; use utf8; package Test::reCAPTCHA; use HTML::FormHandler::I18N; use HTML::FormHandler::Moose; extends 'HTML::FormHandler'; # se non derivasse da DBIC with 'HTML::FormHandlerX::Widget::Field::reCAPTCHA'; has '+is_html5' => (default=>1); has_field 'recaptcha' => ( type=>'reCAPTCHA', recaptcha_message => "Non hai dimostrato di essere un umano!", required=>1, ); has ['recaptcha_public_key','recaptcha_private_key'] => (is => 'rw', isa=>'Str', required=>1); no HTML::FormHandler::Moose; package ::main; #use_ok('Test::reCAPTCHA'); my $public_key = 'zio pino'; my $private_key = 'zio can'; my $form = Test::reCAPTCHA->new(recaptcha_public_key=>$public_key,recaptcha_private_key=>$private_key); ok($form, 'get form'); $form->process(params => {}); ok($form->field('recaptcha')->render, 'OK recaptcha'); my $expected = q( <div> <label for="recaptcha">Recaptcha</label> <script type="text/javascript"> //<![CDATA[ var RecaptchaOptions = {}; //]]> </script> <script src="http://www.google.com/recaptcha/api/challenge?k=zio+pino" type="text/javascript"></script> <noscript><iframe frameborder="0" height="300" src="http://www.google.com/recaptcha/api/noscript?k=zio+pino" width="500"></iframe><textarea cols="40" name="recaptcha_challenge_field" rows="3"></textarea><input name="recaptcha_response_field" type="hidden" value="manual_challenge" /></noscript> </div>); ok($form->field('recaptcha')->render eq $expected, 'recaptcha render OK') || diag($form->field('recaptcha')->render); like($form->field('recaptcha')->render,qr/k=zio\+pino/, 'recaptcha public_key OK') || diag($form->field('recaptcha')->render); -exit; +my $form1 = Test::reCAPTCHA->new(inactive=>['recaptcha'],recaptcha_public_key=>$public_key,recaptcha_private_key=>$private_key); + +ok($form1, 'get form without recaptcha'); + +TODO: { + local $TODO = "recaptcha doesn't seem inactivable"; + eval { + ok($form1->process(params => {}), "process form with recaptcha inactive"); + }; + eval { + ok($form1->render, "OK, render form with recaptcha inactive"); + }; +} + +TODO1: { + $TODO = "form with recaptcha doesn't render if keys are given at runtime"; + ok($form->render, "Fixed form with recaptcha and keys given at runtime"); +} 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
d2c4d220baa11119ee731757ebf5fcdb4a69214e
thanks for the test contrib (ferz++)
diff --git a/t/recaptcha_field.t b/t/recaptcha_field.t new file mode 100644 index 0000000..85a2dcd --- /dev/null +++ b/t/recaptcha_field.t @@ -0,0 +1,62 @@ +#/usr/bin/env perl + +use strict; +use warnings; +use Test::More tests=>4; +use utf8; + +package Test::reCAPTCHA; + +use HTML::FormHandler::I18N; +use HTML::FormHandler::Moose; +extends 'HTML::FormHandler'; # se non derivasse da DBIC + +with 'HTML::FormHandlerX::Widget::Field::reCAPTCHA'; + +has '+is_html5' => (default=>1); + +has_field 'recaptcha' => ( + type=>'reCAPTCHA', + recaptcha_message => "Non hai dimostrato di essere un umano!", + required=>1, +); + +has ['recaptcha_public_key','recaptcha_private_key'] => (is => 'rw', isa=>'Str', required=>1); + +no HTML::FormHandler::Moose; + +package ::main; + +#use_ok('Test::reCAPTCHA'); + +my $public_key = 'zio pino'; +my $private_key = 'zio can'; + +my $form = Test::reCAPTCHA->new(recaptcha_public_key=>$public_key,recaptcha_private_key=>$private_key); + +ok($form, 'get form'); + +$form->process(params => {}); + +ok($form->field('recaptcha')->render, 'OK recaptcha'); + +my $expected = q( +<div> +<label for="recaptcha">Recaptcha</label> +<script type="text/javascript"> +//<![CDATA[ +var RecaptchaOptions = {}; +//]]> +</script> +<script src="http://www.google.com/recaptcha/api/challenge?k=zio+pino" type="text/javascript"></script> +<noscript><iframe frameborder="0" height="300" src="http://www.google.com/recaptcha/api/noscript?k=zio+pino" width="500"></iframe><textarea cols="40" name="recaptcha_challenge_field" rows="3"></textarea><input name="recaptcha_response_field" type="hidden" value="manual_challenge" /></noscript> + +</div>); + +ok($form->field('recaptcha')->render eq $expected, 'recaptcha render OK') || diag($form->field('recaptcha')->render); + +like($form->field('recaptcha')->render,qr/k=zio\+pino/, 'recaptcha public_key OK') || diag($form->field('recaptcha')->render); + +exit; + +1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
54c38a83bfbd1912707351268080e230748ce715
fixed wrong repo
diff --git a/Changes b/Changes index 24b9fe1..60b4fc0 100644 --- a/Changes +++ b/Changes @@ -1,10 +1,13 @@ Revision History for HTML-FormHandlerX-Field-reCAPTCHA 0.01 22 February 2010 -- Initial Release. 0.02 23 February 2010 -- Fixed some documentation typos and busted url links. -- Fixed some POD errors -- Fixed incorrect POD name declaration +0.03 23 February 2010 + -- fixed incorrect repository link + diff --git a/Makefile.PL b/Makefile.PL index 1669fd3..59a9ca9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,18 +1,18 @@ use inc::Module::Install 0.91; use warnings; use strict; all_from 'lib/HTML/FormHandlerX/Field/reCAPTCHA.pm'; -repository 'git://github.com/jjn1056/Test-DBIx-Class.git'; +repository 'git://github.com/jjn1056/HTML-FormHandlerX-Field-reCAPTCHA.git'; requires 'HTML::FormHandler' => '0.30002'; requires 'Crypt::CBC' => '2.30'; requires 'Crypt::Blowfish' => '2.10'; requires 'Captcha::reCAPTCHA' => '0.92'; test_requires 'Test::More' => '0.94'; auto_install; tests_recursive; WriteAll; diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index ade2177..879a019 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,236 +1,236 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; use Moose; extends 'HTML::FormHandler::Field'; -our $VERSION = '0.02'; +our $VERSION = '0.03'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); sub _build_public_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_public_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'public_key' field option or defined a $method method in your form!"; } } sub _build_private_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_private_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'private_key' field option or defined a $method method in your form!"; } } sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost. Please try again."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandlerX::Field::reCAPTCHA - A Captcha::reCAPTCHA field for HTML::FormHandler =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example L<Catalyst> controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from L<http://recaptcha.net/> to make this work. This is a thin wrapper on top of L<Captcha::reCAPTCHA> so you should review the docs for that. However there's not much too it, just register for an account over at L<http://recaptcha.net> and use it. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on L<http://recaptcha.net/> =head2 private_key The private key you get when you create an account on L<http://recaptcha.net/> =head2 use_ssl control the 'use_ssl' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_options control the 'options' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_message What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. This error message is in addition to any other constraints you add, such as 'required'. Please note that the recaptcha control also displays an error message internal to itself. =head1 FORM METHODS The following methods or attributes can be set in the form which contains the recapcha field. =head2 $name_public_key or $name_private_key "$name" is the name you gave to the reCAPTCHA field (the word directy after the "has_field" command. You may wish to set your public key from a method or attribute contained from within the form. This would make it easier to have one form class and use configuration tools, such as what L<Catalyst> offers, to set the pubic key. For example: ## In my form "MyApp::Form::MyForm has ['MY_recaptcha_public_key', 'MY_recapcha_private_key'] => ( is=>'ro', isa=>'Str', required=>1, ); has_field 'MY_recaptcha' => ( type=>'reCAPTCHA', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Then you might construct this in a L<Catalyst::Controller>: my $form = MyApp::Form::MyForm->new( MY_recaptcha_public_key => $self->controller_public_key, MY_recaptcha_private_key => $self->controller_private_key, ); ## 'process', etc. Then your controller could populate the attributes 'controller_public_key' and 'controller_private_key' from your global L<Catalyst> configuration, allowing you to use one set of keys in development and another for production, or even use different keys for different forms if you wish. =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. L<http://shutterstock.com> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
fe12778736f2d31a34f2d6747a7608910457a642
fixes to prep version 0.02
diff --git a/Changes b/Changes index d2867e9..24b9fe1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision History for HTML-FormHandlerX-Field-reCAPTCHA 0.01 22 February 2010 -- Initial Release. +0.02 23 February 2010 + -- Fixed some documentation typos and busted url links. + -- Fixed some POD errors + -- Fixed incorrect POD name declaration + diff --git a/README b/README index 223e554..33e78d8 100644 --- a/README +++ b/README @@ -1,118 +1,123 @@ NAME - HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field + HTML::FormHandlerX::Field::reCAPTCHA - A Captcha::reCAPTCHA field for + HTML::FormHandler SYNOPSIS The following is example usage. In your HTML::FormHandler subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', recaptcha_message => "You're failed to prove your Humanity!", required=>1, - ); + ); Example Catalyst controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } DESCRIPTION Uses Captcha::reCAPTCHA to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. This is a thin wrapper on top of Captcha::reCAPTCHA so you should review the docs for that. However there's not much too it, just register for an - account over at http://recaptcha.org and use it. - - When creating an account, I'd recommend creating two, one for testing or - development and is not domain locked, and another one for production - which is. + account over at http://recaptcha.net and use it. FIELD OPTIONS We support the following additional field options, over what is inherited from HTML::FormHandler::Field public_key + The public key you get when you create an account on http://recaptcha.net/ private_key + The private key you get when you create an account on http://recaptcha.net/ use_ssl + control the 'use_ssl' option in Captcha::reCAPTCHA when calling 'get_html'. recaptcha_options + control the 'options' option in Captcha::reCAPTCHA when calling 'get_html'. recaptcha_message + What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. This error message is in addition to any other constraints you add, such as 'required'. + Please note that the recaptcha control also displays an error message + internal to itself. + FORM METHODS The following methods or attributes can be set in the form which contains the recapcha field. $name_public_key or $name_private_key + "$name" is the name you gave to the reCAPTCHA field (the word directy after the "has_field" command. You may wish to set your public key from a method or attribute contained from within the form. This would make it easier to have one form class and use configuration tools, such as what Catalyst offers, to set the pubic key. For example: ## In my form "MyApp::Form::MyForm - has ['recaptcha_public_key', 'recapcha_private_key'] => ( + has ['MY_recaptcha_public_key', 'MY_recapcha_private_key'] => ( is=>'ro', isa=>'Str', required=>1, ); - has_field 'recaptcha' => ( + has_field 'MY_recaptcha' => ( type=>'reCAPTCHA', recaptcha_message => "You're failed to prove your Humanity!", required=>1, - ); + ); Then you might construct this in a Catalyst::Controller: my $form = MyApp::Form::MyForm->new( - recaptcha_public_key => $self->controller_public_key, - recaptcha_private_key => $self->controller_private_key, + MY_recaptcha_public_key => $self->controller_public_key, + MY_recaptcha_private_key => $self->controller_private_key, ); ## 'process', etc. Then your controller could populate the attributes - 'controller_public_key' and 'controller_private_key' from your gloval - Catalyst Configuration, allowing you to use one set of keys in - development and another for production, or even use differnt keys for - differnt forms if you wish. + 'controller_public_key' and 'controller_private_key' from your global + Catalyst configuration, allowing you to use one set of keys in + development and another for production, or even use different keys for + different forms if you wish. SEE ALSO The following modules or resources may be of interest. HTML::FormHandler, Captch::reCAPTCHA AUTHOR - John Napiorkowski "<[email protected]>" + John Napiorkowski `<[email protected]>' COPYRIGHT & LICENSE - Copyright 2010, John Napiorkowski "<[email protected]>" + Copyright 2010, John Napiorkowski `<[email protected]>' - Original work sponsered by Shutterstock, LLC. <<a - href="http://shutterstock.com/">http://shutterstock.com</a>> + Original work sponsered by Shutterstock, LLC. http://shutterstock.com This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 2e77f8a..ade2177 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,236 +1,236 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; use Moose; extends 'HTML::FormHandler::Field'; -our $VERSION = '0.01'; +our $VERSION = '0.02'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); sub _build_public_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_public_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'public_key' field option or defined a $method method in your form!"; } } sub _build_private_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_private_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'private_key' field option or defined a $method method in your form!"; } } sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost. Please try again."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME -HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field +HTML::FormHandlerX::Field::reCAPTCHA - A Captcha::reCAPTCHA field for HTML::FormHandler =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example L<Catalyst> controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You -will need an account from http://recaptcha.net/ to make this work. +will need an account from L<http://recaptcha.net/> to make this work. This is a thin wrapper on top of L<Captcha::reCAPTCHA> so you should review the docs for that. However there's not much too it, just register for an account -over at http://recaptcha.org and use it. - -When creating an account, I'd recommend creating two, one for testing or -development and is not domain locked, and another one for production which is. +over at L<http://recaptcha.net> and use it. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key -The public key you get when you create an account on http://recaptcha.net/ +The public key you get when you create an account on L<http://recaptcha.net/> =head2 private_key -The private key you get when you create an account on http://recaptcha.net/ +The private key you get when you create an account on L<http://recaptcha.net/> =head2 use_ssl control the 'use_ssl' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_options control the 'options' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_message What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. This error message is in addition to any other constraints you add, such as 'required'. +Please note that the recaptcha control also displays an error message internal +to itself. + =head1 FORM METHODS The following methods or attributes can be set in the form which contains the recapcha field. =head2 $name_public_key or $name_private_key "$name" is the name you gave to the reCAPTCHA field (the word directy after the "has_field" command. You may wish to set your public key from a method or attribute contained from within the form. This would make it easier to have one form class and use configuration tools, such as what L<Catalyst> offers, to set the pubic key. For example: ## In my form "MyApp::Form::MyForm - has ['recaptcha_public_key', 'recapcha_private_key'] => ( + has ['MY_recaptcha_public_key', 'MY_recapcha_private_key'] => ( is=>'ro', isa=>'Str', required=>1, ); - has_field 'recaptcha' => ( + has_field 'MY_recaptcha' => ( type=>'reCAPTCHA', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Then you might construct this in a L<Catalyst::Controller>: my $form = MyApp::Form::MyForm->new( - recaptcha_public_key => $self->controller_public_key, - recaptcha_private_key => $self->controller_private_key, + MY_recaptcha_public_key => $self->controller_public_key, + MY_recaptcha_private_key => $self->controller_private_key, ); ## 'process', etc. Then your controller could populate the attributes 'controller_public_key' and -'controller_private_key' from your gloval L<Catalyst> Configuration, allowing +'controller_private_key' from your global L<Catalyst> configuration, allowing you to use one set of keys in development and another for production, or even -use differnt keys for differnt forms if you wish. +use different keys for different forms if you wish. =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. -<<a href="http://code.shutterstock.com/">http://shutterstock.com</a>> +L<http://shutterstock.com> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
8ad954e88f473b43b9eb859d0f7097b0218d3d1e
adding manifest skipping
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP new file mode 100644 index 0000000..e69de29
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
39eb4f3f61135f75bdbba130992e2f775ed837f7
added changelog
diff --git a/Changes b/Changes new file mode 100644 index 0000000..d2867e9 --- /dev/null +++ b/Changes @@ -0,0 +1,5 @@ +Revision History for HTML-FormHandlerX-Field-reCAPTCHA + +0.01 22 February 2010 + -- Initial Release. +
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
7dbd7f5af18c3ede496e9ff890377a67f1e36a39
minor doc change
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 21a04b7..2e77f8a 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,236 +1,236 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); sub _build_public_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_public_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'public_key' field option or defined a $method method in your form!"; } } sub _build_private_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_private_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'private_key' field option or defined a $method method in your form!"; } } sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost. Please try again."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example L<Catalyst> controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. This is a thin wrapper on top of L<Captcha::reCAPTCHA> so you should review the docs for that. However there's not much too it, just register for an account over at http://recaptcha.org and use it. When creating an account, I'd recommend creating two, one for testing or development and is not domain locked, and another one for production which is. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ =head2 use_ssl control the 'use_ssl' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_options control the 'options' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_message What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. This error message is in addition to any other constraints you add, such as 'required'. =head1 FORM METHODS The following methods or attributes can be set in the form which contains the recapcha field. =head2 $name_public_key or $name_private_key "$name" is the name you gave to the reCAPTCHA field (the word directy after the "has_field" command. You may wish to set your public key from a method or attribute contained from within the form. This would make it easier to have one form class and use configuration tools, such as what L<Catalyst> offers, to set the pubic key. For example: ## In my form "MyApp::Form::MyForm has ['recaptcha_public_key', 'recapcha_private_key'] => ( is=>'ro', isa=>'Str', required=>1, ); has_field 'recaptcha' => ( type=>'reCAPTCHA', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Then you might construct this in a L<Catalyst::Controller>: my $form = MyApp::Form::MyForm->new( recaptcha_public_key => $self->controller_public_key, recaptcha_private_key => $self->controller_private_key, ); ## 'process', etc. Then your controller could populate the attributes 'controller_public_key' and 'controller_private_key' from your gloval L<Catalyst> Configuration, allowing you to use one set of keys in development and another for production, or even use differnt keys for differnt forms if you wish. =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. -<<a href="http://shutterstock.com/">http://shutterstock.com</a>> +<<a href="http://code.shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
bdb1d07310a76d27c80459150fccff42bb1ff9f0
Added docs for the new form methods and rebuilt the README
diff --git a/README b/README index d63dbf3..223e554 100644 --- a/README +++ b/README @@ -1,58 +1,118 @@ NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field SYNOPSIS The following is example usage. - In your HTML::FormHandler subclass: + In your HTML::FormHandler subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', + recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example Catalyst controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } DESCRIPTION Uses Captcha::reCAPTCHA to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. + This is a thin wrapper on top of Captcha::reCAPTCHA so you should review + the docs for that. However there's not much too it, just register for an + account over at http://recaptcha.org and use it. + + When creating an account, I'd recommend creating two, one for testing or + development and is not domain locked, and another one for production + which is. + FIELD OPTIONS We support the following additional field options, over what is inherited from HTML::FormHandler::Field public_key The public key you get when you create an account on http://recaptcha.net/ private_key The private key you get when you create an account on http://recaptcha.net/ + use_ssl + control the 'use_ssl' option in Captcha::reCAPTCHA when calling + 'get_html'. + + recaptcha_options + control the 'options' option in Captcha::reCAPTCHA when calling + 'get_html'. + + recaptcha_message + What to show if the recaptcha fails. Defaults to 'Error validating + reCAPTCHA'. This error message is in addition to any other constraints + you add, such as 'required'. + +FORM METHODS + The following methods or attributes can be set in the form which + contains the recapcha field. + + $name_public_key or $name_private_key + "$name" is the name you gave to the reCAPTCHA field (the word directy + after the "has_field" command. + + You may wish to set your public key from a method or attribute contained + from within the form. This would make it easier to have one form class + and use configuration tools, such as what Catalyst offers, to set the + pubic key. For example: + + ## In my form "MyApp::Form::MyForm + has ['recaptcha_public_key', 'recapcha_private_key'] => ( + is=>'ro', isa=>'Str', required=>1, + ); + has_field 'recaptcha' => ( + type=>'reCAPTCHA', + recaptcha_message => "You're failed to prove your Humanity!", + required=>1, + ); + + Then you might construct this in a Catalyst::Controller: + + my $form = MyApp::Form::MyForm->new( + recaptcha_public_key => $self->controller_public_key, + recaptcha_private_key => $self->controller_private_key, + ); + + ## 'process', etc. + + Then your controller could populate the attributes + 'controller_public_key' and 'controller_private_key' from your gloval + Catalyst Configuration, allowing you to use one set of keys in + development and another for production, or even use differnt keys for + differnt forms if you wish. + SEE ALSO The following modules or resources may be of interest. HTML::FormHandler, Captch::reCAPTCHA AUTHOR John Napiorkowski "<[email protected]>" COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski "<[email protected]>" Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index a4b34e5..21a04b7 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,197 +1,236 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); sub _build_public_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_public_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'public_key' field option or defined a $method method in your form!"; } } sub _build_private_key { my $self = shift @_; my $form = $self->form; my $method = $self->name.'_private_key'; if ($form->can($method)) { return $form->$method; } else { die "You either have to set the 'private_key' field option or defined a $method method in your form!"; } } sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost. Please try again."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example L<Catalyst> controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. This is a thin wrapper on top of L<Captcha::reCAPTCHA> so you should review the docs for that. However there's not much too it, just register for an account over at http://recaptcha.org and use it. When creating an account, I'd recommend creating two, one for testing or development and is not domain locked, and another one for production which is. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ =head2 use_ssl control the 'use_ssl' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_options control the 'options' option in L<Captcha::reCAPTCHA> when calling 'get_html'. =head2 recaptcha_message What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. This error message is in addition to any other constraints you add, such as 'required'. +=head1 FORM METHODS + +The following methods or attributes can be set in the form which contains the +recapcha field. + +=head2 $name_public_key or $name_private_key + +"$name" is the name you gave to the reCAPTCHA field (the word directy after the +"has_field" command. + +You may wish to set your public key from a method or attribute contained from +within the form. This would make it easier to have one form class and use +configuration tools, such as what L<Catalyst> offers, to set the pubic key. +For example: + + ## In my form "MyApp::Form::MyForm + has ['recaptcha_public_key', 'recapcha_private_key'] => ( + is=>'ro', isa=>'Str', required=>1, + ); + has_field 'recaptcha' => ( + type=>'reCAPTCHA', + recaptcha_message => "You're failed to prove your Humanity!", + required=>1, + ); + +Then you might construct this in a L<Catalyst::Controller>: + + my $form = MyApp::Form::MyForm->new( + recaptcha_public_key => $self->controller_public_key, + recaptcha_private_key => $self->controller_private_key, + ); + + ## 'process', etc. + +Then your controller could populate the attributes 'controller_public_key' and +'controller_private_key' from your gloval L<Catalyst> Configuration, allowing +you to use one set of keys in development and another for production, or even +use differnt keys for differnt forms if you wish. + =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
56faffb2a7e326c07b0cee5f99fae80f58c02e75
added more docs and allowed people to declare the public/private key in a form method/attribute
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 3997165..a4b34e5 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,161 +1,197 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); -has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); +has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', lazy_build=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); +sub _build_public_key { + my $self = shift @_; + my $form = $self->form; + my $method = $self->name.'_public_key'; + if ($form->can($method)) { + return $form->$method; + } else { + die "You either have to set the 'public_key' field option or defined a $method method in your form!"; + } +} + +sub _build_private_key { + my $self = shift @_; + my $form = $self->form; + my $method = $self->name.'_private_key'; + if ($form->can($method)) { + return $form->$method; + } else { + die "You either have to set the 'private_key' field option or defined a $method method in your form!"; + } +} + sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } -sub prepare_public_recaptcha_args { - my $self = shift @_; - return ( - $self->public_key, - $self->prepare_recaptcha_args, - ); -} - sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { - $self->add_error("Previous reCAPTCHA validation lost."); + $self->add_error("Previous reCAPTCHA validation lost. Please try again."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. -In your L<HTML::FormHandler> subclass: +In your L<HTML::FormHandler> subclass, "MyApp::HTML::Forms::MyForm": has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', + recaptcha_message => "You're failed to prove your Humanity!", required=>1, ); Example L<Catalyst> controller: my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. +This is a thin wrapper on top of L<Captcha::reCAPTCHA> so you should review the +docs for that. However there's not much too it, just register for an account +over at http://recaptcha.org and use it. + +When creating an account, I'd recommend creating two, one for testing or +development and is not domain locked, and another one for production which is. + =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ +=head2 use_ssl + +control the 'use_ssl' option in L<Captcha::reCAPTCHA> when calling 'get_html'. + +=head2 recaptcha_options + +control the 'options' option in L<Captcha::reCAPTCHA> when calling 'get_html'. + +=head2 recaptcha_message + +What to show if the recaptcha fails. Defaults to 'Error validating reCAPTCHA'. +This error message is in addition to any other constraints you add, such as +'required'. + =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm index 4cc8e3c..0ab4d7e 100644 --- a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm @@ -1,24 +1,33 @@ package HTML::FormHandlerX::Widget::Field::reCAPTCHA; use Moose::Role; sub render { my ( $self, $result ) = @_; $result ||= $self->result; if( !$self->value || ($self->value && $self->has_errors)) { my @args = $self->prepare_public_recaptcha_args; - my $err = $self->{recaptcha_error}; - my $output = $self->recaptcha_instance->get_html(@args, $err); + my $output = $self->recaptcha_instance->get_html(@args); return $self->wrap_field($result, $output); } else { my $security_code = $self->encrypt_hex($self->public_key); return <<"END"; <input type='hidden' name='recaptcha_response_field' value='$security_code' /> <input type='hidden' name='recaptcha_already_validated' value='1' /> END } } +sub prepare_public_recaptcha_args { + my $self = shift @_; + return ( + $self->public_key, + $self->{recaptcha_error}, + $self->use_ssl, + $self->recaptcha_options, + ); +} + use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
c4c404694bfec297ee96a7518005a91a29585754
fixed up docs related to previous
diff --git a/README b/README index 8d915c1..d63dbf3 100644 --- a/README +++ b/README @@ -1,77 +1,58 @@ NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field SYNOPSIS The following is example usage. In your HTML::FormHandler subclass: - has 'valid_recaptcha_security_code' => ( - is=>'rw', - required=>1, - ); - has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example Catalyst controller: - ## Probably not the most secure code :) - my $form = MyApp::HTML::Forms::MyForm->new( - valid_recaptcha_security_code=>$c->session_id, - ); - + my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } DESCRIPTION Uses Captcha::reCAPTCHA to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. FIELD OPTIONS We support the following additional field options, over what is inherited from HTML::FormHandler::Field public_key The public key you get when you create an account on http://recaptcha.net/ private_key The private key you get when you create an account on http://recaptcha.net/ -FORM ATTRIBUTES - We support the following form attributes - - valid_recaptcha_security_code - Expects a value. The idea here is that if your client validates the - reCAPTCHA but makes some other error, you don't want to keep displaying - the reCAPTCHA. So the first time a form validates the reCAPTCHA we - replace it with a hidden field whose value is a secure code you can - control. - SEE ALSO The following modules or resources may be of interest. HTML::FormHandler, Captch::reCAPTCHA AUTHOR John Napiorkowski "<[email protected]>" COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski "<[email protected]>" Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 2ee1090..3997165 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,181 +1,161 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Crypt::CBC; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, handles=>[qw/encrypt_hex decrypt_hex/]); sub _build_encrypter { my $self = shift @_; my $key = pack("H16",$self->private_key); return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { if($recaptcha_response_field && ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass: - has 'valid_recaptcha_security_code' => ( - is=>'rw', - required=>1, - ); - has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example L<Catalyst> controller: - ## Probably not the most secure code :) - my $form = MyApp::HTML::Forms::MyForm->new( - valid_recaptcha_security_code=>$c->session_id, - ); - + my $form = MyApp::HTML::Forms::MyForm->new; my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ -=head1 FORM ATTRIBUTES - -We support the following form attributes - -=head2 valid_recaptcha_security_code - -Expects a value. The idea here is that if your client validates the reCAPTCHA -but makes some other error, you don't want to keep displaying the reCAPTCHA. So -the first time a form validates the reCAPTCHA we replace it with a hidden field -whose value is a secure code you can control. - =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
5789f3c5ee57120f1a797b22c25ef1ac55fd3ac7
trying to remove the message security key thing
diff --git a/Makefile.PL b/Makefile.PL index d46d677..eacec4f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,16 +1,18 @@ use inc::Module::Install 0.91; use warnings; use strict; all_from 'lib/HTML/FormHandlerX/Field/reCAPTCHA.pm'; repository 'git://github.com/jjn1056/Test-DBIx-Class.git'; requires 'HTML::FormHandler' => '0.30001'; +requires 'Crypt::CBC' => '2.30'; +requires 'Crypt::Blowfish' => '2.10'; requires 'Captcha::reCAPTCHA' => '0.92'; test_requires 'Test::More' => '0.94'; auto_install; tests_recursive; WriteAll; diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index eb106c2..2ee1090 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,183 +1,181 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; +use Crypt::CBC; + use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); -has 'security_code' => (is=>'rw', init_arg=>undef, lazy_build=>1); +has 'encrypter' => (is=>'ro', init_arg=>undef, lazy_build=>1, + handles=>[qw/encrypt_hex decrypt_hex/]); -sub _build_security_code { +sub _build_encrypter { my $self = shift @_; - my $form = $self->form; - my $method_name = 'valid_'.$self->name.'_security_code'; - if($form->can($method_name)) { - return $form->$method_name; - } else { - return '01232005'; - } + my $key = pack("H16",$self->private_key); + return Crypt::CBC->new(-key=>$key,-cipher=>"Blowfish"); } sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; unless(my $super = $self->SUPER::validate) { return $super; } - my $security_code = $self->security_code; + my $recaptcha_response_field = $self->form->params->{'recaptcha_response_field'}; if($self->form->params->{'recaptcha_already_validated'}) { - if( $self->form->params->{'recaptcha_response_field'} && - ($self->form->params->{'recaptcha_response_field'} eq $security_code) + if($recaptcha_response_field && + ($self->decrypt_hex($recaptcha_response_field) eq $self->public_key) ) { return 1; } else { $self->add_error("Previous reCAPTCHA validation lost."); return undef; } } else { my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->{recaptcha_error} = $result->{error}; $self->add_error($self->recaptcha_message); return undef; } } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass: has 'valid_recaptcha_security_code' => ( is=>'rw', required=>1, ); has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example L<Catalyst> controller: ## Probably not the most secure code :) my $form = MyApp::HTML::Forms::MyForm->new( valid_recaptcha_security_code=>$c->session_id, ); my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ =head1 FORM ATTRIBUTES We support the following form attributes =head2 valid_recaptcha_security_code Expects a value. The idea here is that if your client validates the reCAPTCHA but makes some other error, you don't want to keep displaying the reCAPTCHA. So the first time a form validates the reCAPTCHA we replace it with a hidden field whose value is a secure code you can control. =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm index d75887c..4cc8e3c 100644 --- a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm @@ -1,24 +1,24 @@ package HTML::FormHandlerX::Widget::Field::reCAPTCHA; use Moose::Role; sub render { my ( $self, $result ) = @_; $result ||= $self->result; if( !$self->value || ($self->value && $self->has_errors)) { my @args = $self->prepare_public_recaptcha_args; my $err = $self->{recaptcha_error}; my $output = $self->recaptcha_instance->get_html(@args, $err); return $self->wrap_field($result, $output); } else { - my $security_code = $self->security_code; + my $security_code = $self->encrypt_hex($self->public_key); return <<"END"; <input type='hidden' name='recaptcha_response_field' value='$security_code' /> <input type='hidden' name='recaptcha_already_validated' value='1' /> END } } use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
4cc4675da5318932310321266ac6b6e65ba84a6b
fixed readme
diff --git a/README b/README index 95938f5..8d915c1 100644 --- a/README +++ b/README @@ -1,57 +1,77 @@ NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field SYNOPSIS The following is example usage. In your HTML::FormHandler subclass: + has 'valid_recaptcha_security_code' => ( + is=>'rw', + required=>1, + ); + has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example Catalyst controller: + ## Probably not the most secure code :) + my $form = MyApp::HTML::Forms::MyForm->new( + valid_recaptcha_security_code=>$c->session_id, + ); + my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } DESCRIPTION Uses Captcha::reCAPTCHA to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. FIELD OPTIONS We support the following additional field options, over what is inherited from HTML::FormHandler::Field public_key The public key you get when you create an account on http://recaptcha.net/ private_key The private key you get when you create an account on http://recaptcha.net/ +FORM ATTRIBUTES + We support the following form attributes + + valid_recaptcha_security_code + Expects a value. The idea here is that if your client validates the + reCAPTCHA but makes some other error, you don't want to keep displaying + the reCAPTCHA. So the first time a form validates the reCAPTCHA we + replace it with a hidden field whose value is a secure code you can + control. + SEE ALSO The following modules or resources may be of interest. HTML::FormHandler, Captch::reCAPTCHA AUTHOR John Napiorkowski "<[email protected]>" COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski "<[email protected]>" Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
9dd74b9ac7ff409050909b849f861ea26eca3f40
hopefully ready for release
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 30dcc38..eb106c2 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,136 +1,183 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Captcha::reCAPTCHA; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); +has 'security_code' => (is=>'rw', init_arg=>undef, lazy_build=>1); + +sub _build_security_code { + my $self = shift @_; + my $form = $self->form; + my $method_name = 'valid_'.$self->name.'_security_code'; + if($form->can($method_name)) { + return $form->$method_name; + } else { + return '01232005'; + } +} sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; - return unless $self->SUPER::validate;warn "2222222\n\n"; - - my @args = $self->prepare_private_recaptcha_args; - my $result = $self->recaptcha_instance->check_answer(@args); - if($result->{is_valid}) { - return 1; + unless(my $super = $self->SUPER::validate) { + return $super; + } + my $security_code = $self->security_code; + if($self->form->params->{'recaptcha_already_validated'}) { + if( $self->form->params->{'recaptcha_response_field'} && + ($self->form->params->{'recaptcha_response_field'} eq $security_code) + ) { + return 1; + } else { + $self->add_error("Previous reCAPTCHA validation lost."); + return undef; + } } else { - $self->add_error($self->recaptcha_message); - return undef; + my @args = $self->prepare_private_recaptcha_args; + my $result = $self->recaptcha_instance->check_answer(@args); + if($result->{is_valid}) { + return 1; + } else { + $self->{recaptcha_error} = $result->{error}; + $self->add_error($self->recaptcha_message); + return undef; + } } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass: + has 'valid_recaptcha_security_code' => ( + is=>'rw', + required=>1, + ); + has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example L<Catalyst> controller: + ## Probably not the most secure code :) + my $form = MyApp::HTML::Forms::MyForm->new( + valid_recaptcha_security_code=>$c->session_id, + ); + my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ +=head1 FORM ATTRIBUTES + +We support the following form attributes + +=head2 valid_recaptcha_security_code + +Expects a value. The idea here is that if your client validates the reCAPTCHA +but makes some other error, you don't want to keep displaying the reCAPTCHA. So +the first time a form validates the reCAPTCHA we replace it with a hidden field +whose value is a secure code you can control. + =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm index bdc664e..d75887c 100644 --- a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm @@ -1,15 +1,24 @@ package HTML::FormHandlerX::Widget::Field::reCAPTCHA; use Moose::Role; sub render { my ( $self, $result ) = @_; $result ||= $self->result; - my @args = $self->prepare_public_recaptcha_args; - my $output = $self->recaptcha_instance->get_html(@args); - return $self->wrap_field( $result, $output ); + if( !$self->value || ($self->value && $self->has_errors)) { + my @args = $self->prepare_public_recaptcha_args; + my $err = $self->{recaptcha_error}; + my $output = $self->recaptcha_instance->get_html(@args, $err); + return $self->wrap_field($result, $output); + } else { + my $security_code = $self->security_code; + return <<"END"; + <input type='hidden' name='recaptcha_response_field' value='$security_code' /> + <input type='hidden' name='recaptcha_already_validated' value='1' /> +END + } } use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
12fd439b7190acd37dc75a9ee117ac0b59fe7861
sync with upstream changes
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 1ce6759..30dcc38 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,138 +1,136 @@ package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; +use Captcha::reCAPTCHA; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'reCAPTCHA' ); +has '+input_param' => ( default => 'recaptcha_response_field' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); sub _build_remote_address { $ENV{REMOTE_ADDR}; } -sub _build_input_param { - return 'recaptcha_response_field'; -} - sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; - return unless $self->SUPER::validate; + return unless $self->SUPER::validate;warn "2222222\n\n"; my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->add_error($self->recaptcha_message); return undef; } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass: has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example L<Catalyst> controller: my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/t/basic.t b/t/basic.t new file mode 100644 index 0000000..3a51ccc --- /dev/null +++ b/t/basic.t @@ -0,0 +1,18 @@ +package Test::HTML::FormHandlerX::Field::reCAPTCHA; + +use HTML::FormHandler::Moose; +extends 'HTML::FormHandler'; + +has_field 'recaptcha' => ( + type=>'reCAPTCHA', + public_key=>'public', + private_key=>'private', + required=>1, +); + +use Test::More; + +ok my $form = Test::HTML::FormHandlerX::Field::reCAPTCHA->new, + 'Created Form'; + +done_testing;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
487cd1532c3aa4fd18df0fbe32969616fed68705
basics in place
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 74314e0..1ce6759 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,138 +1,138 @@ -package HTML::FormHandler::Field::reCAPTCHA; +package HTML::FormHandlerX::Field::reCAPTCHA; use 5.008; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; -has '+widget' => ( default => 'recaptcha' ); +has '+widget' => ( default => 'reCAPTCHA' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_input_param { return 'recaptcha_response_field'; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; return unless $self->SUPER::validate; my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->add_error($self->recaptcha_message); return undef; } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS The following is example usage. In your L<HTML::FormHandler> subclass: has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', required=>1, ); Example L<Catalyst> controller: my $params = $c->request->body_parameters; if(my $result = $form->process(params=>$params) { ## The Form is totally valid. Go ahead with whatever is next. } else { ## Invalid results, you need to display errors and try again. } =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm index 79524f4..bdc664e 100644 --- a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm @@ -1,15 +1,15 @@ -package HTML::FormHandler::Widget::Field::reCAPTCHA; +package HTML::FormHandlerX::Widget::Field::reCAPTCHA; use Moose::Role; sub render { my ( $self, $result ) = @_; $result ||= $self->result; my @args = $self->prepare_public_recaptcha_args; my $output = $self->recaptcha_instance->get_html(@args); return $self->wrap_field( $result, $output ); } use namespace::autoclean; 1; diff --git a/t/load.t b/t/load.t index 2985ab0..af4f780 100644 --- a/t/load.t +++ b/t/load.t @@ -1,6 +1,6 @@ use Test::More; use_ok 'HTML::FormHandlerX::Field::reCAPTCHA'; use_ok 'HTML::FormHandlerX::Widget::Field::reCAPTCHA'; - + done_testing;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
83ccf0b213d88270cfce62791286616fb7b0ed7e
get rid of the same security salt thing. Punt with an example to let the end user handle this
diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index bb85157..74314e0 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,154 +1,138 @@ package HTML::FormHandler::Field::reCAPTCHA; use 5.008; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; has '+widget' => ( default => 'recaptcha' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); -has 'security_salt' => (is=>'ro', required=>1, isa=>'CodeRef', default=>sub {01232005}); sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_input_param { return 'recaptcha_response_field'; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; return unless $self->SUPER::validate; - my $security_salt = $self->security_salt->($self->parent->form, $self); - if($self->form->params->{'recaptcha_already_validated'}) { - if( $self->form->params->{'recaptcha_response_field'} && - ($self->form->params->{'recaptcha_response_field'} eq $security_salt) - ) { - return 1; - } else { - $self->add_error("Previous reCAPTCHA validation lost."); - return undef; - } + my @args = $self->prepare_private_recaptcha_args; + my $result = $self->recaptcha_instance->check_answer(@args); + if($result->{is_valid}) { + return 1; } else { - my @args = $self->prepare_private_recaptcha_args; - my $result = $self->recaptcha_instance->check_answer(@args); - if($result->{is_valid}) { - return 1; - } else { - $self->add_error($self->recaptcha_message); - return undef; - } + $self->add_error($self->recaptcha_message); + return undef; } } =head1 NAME HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field =head1 SYNOPSIS -The following is example usage +The following is example usage. + +In your L<HTML::FormHandler> subclass: - has 'security_salt' => (is=>'ro', required=>1, isa=>'Str'); has_field 'recaptcha' => ( type=>'reCAPTCHA', public_key=>'[YOUR PUBLIC KEY]', private_key=>'[YOUR PRIVATE KEY]', - security_salt=>sub { - my ($self, $field) = @_; - return $self->security_salt; - }, required=>1, ); +Example L<Catalyst> controller: + + my $params = $c->request->body_parameters; + if(my $result = $form->process(params=>$params) { + ## The Form is totally valid. Go ahead with whatever is next. + } else { + ## Invalid results, you need to display errors and try again. + } + =head1 DESCRIPTION Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You will need an account from http://recaptcha.net/ to make this work. =head1 FIELD OPTIONS We support the following additional field options, over what is inherited from L<HTML::FormHandler::Field> =head2 public_key The public key you get when you create an account on http://recaptcha.net/ =head2 private_key The private key you get when you create an account on http://recaptcha.net/ -=head2 security_salt - -Sometimes your user may properly validate recaptcha, but input an invald an -response to some other field. Accordingly, we support the idea that once the -reCAPTCHA is validated, you can supply a private 'salt' which makes the field -as valid for a certain set of requests. You need to manage this in the code -that is calling the form object. See the SYNOPSIS example for an easy way to -do this in L<Catalyst> with L<Catalyst::Plugin::Session> install. - =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm index 948b389..79524f4 100644 --- a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm @@ -1,23 +1,15 @@ package HTML::FormHandler::Widget::Field::reCAPTCHA; use Moose::Role; sub render { my ( $self, $result ) = @_; $result ||= $self->result; - - if($self->validated) { - my $security_salt = $self->security_salt->($self->parent->form, $self); - return <<"END"; - <input type='hidden' name='recaptcha_response_field' value='$security_salt' /> - <input type='hidden' name='recaptcha_already_validated' value='1' /> -END - } else { - my @args = $self->prepare_public_recaptcha_args; - my $output = $self->recaptcha_instance->get_html(@args); - return $self->wrap_field( $result, $output ); - } + + my @args = $self->prepare_public_recaptcha_args; + my $output = $self->recaptcha_instance->get_html(@args); + return $self->wrap_field( $result, $output ); } use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
987fb425fdc2b4d951fd8377c79dd8546db8b669
added recapcha to makefile and cleaned up docs, fixed security salt thing.
diff --git a/Makefile.PL b/Makefile.PL index 0faaf15..d46d677 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,14 +1,16 @@ use inc::Module::Install 0.91; use warnings; use strict; all_from 'lib/HTML/FormHandlerX/Field/reCAPTCHA.pm'; repository 'git://github.com/jjn1056/Test-DBIx-Class.git'; requires 'HTML::FormHandler' => '0.30001'; +requires 'Captcha::reCAPTCHA' => '0.92'; + test_requires 'Test::More' => '0.94'; auto_install; tests_recursive; WriteAll; diff --git a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm index 6aba03a..bb85157 100644 --- a/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Field/reCAPTCHA.pm @@ -1,109 +1,154 @@ package HTML::FormHandler::Field::reCAPTCHA; use 5.008; use Moose; extends 'HTML::FormHandler::Field'; our $VERSION = '0.01'; our $AUTHORITY = 'cpan:JJNAPIORK'; - has '+widget' => ( default => 'recaptcha' ); has [qw/public_key private_key/] => (is=>'rw', isa=>'Str', required=>1); has 'use_ssl' => (is=>'rw', isa=>'Bool', required=>1, default=>0); has 'remote_address' => (is=>'rw', isa=>'Str', lazy_build=>1); has 'recaptcha_options' => (is=>'rw', isa=>'HashRef', required=>1, default=>sub{ +{} }); has 'recaptcha_message' => (is=>'rw', isa=>'Str', default=>'Error validating reCAPTCHA'); has 'recaptcha_instance' => (is=>'ro', init_arg=>undef, lazy_build=>1); -has 'security_salt' => (is=>'ro', required=>1, default=>01232005); +has 'security_salt' => (is=>'ro', required=>1, isa=>'CodeRef', default=>sub {01232005}); sub _build_remote_address { $ENV{REMOTE_ADDR}; } sub _build_input_param { return 'recaptcha_response_field'; } sub _build_recaptcha_instance { Captcha::reCAPTCHA->new(); } sub prepare_private_recaptcha_args { my $self = shift @_; return ( $self->private_key, $self->prepare_recaptcha_args, ); } sub prepare_public_recaptcha_args { my $self = shift @_; return ( $self->public_key, $self->prepare_recaptcha_args, ); } sub prepare_recaptcha_args { my $self = shift @_; return ( $self->remote_address, $self->form->params->{'recaptcha_challenge_field'}, $self->form->params->{'recaptcha_response_field'}, ); } sub validate { my ($self, @rest) = @_; return unless $self->SUPER::validate; - my @args = $self->prepare_private_recaptcha_args; + my $security_salt = $self->security_salt->($self->parent->form, $self); if($self->form->params->{'recaptcha_already_validated'}) { - return 1; + if( $self->form->params->{'recaptcha_response_field'} && + ($self->form->params->{'recaptcha_response_field'} eq $security_salt) + ) { + return 1; + } else { + $self->add_error("Previous reCAPTCHA validation lost."); + return undef; + } } else { + my @args = $self->prepare_private_recaptcha_args; my $result = $self->recaptcha_instance->check_answer(@args); if($result->{is_valid}) { return 1; } else { $self->add_error($self->recaptcha_message); - ## $self->add_error($result->{error}); return undef; } } } =head1 NAME -HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field +HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field + +=head1 SYNOPSIS + +The following is example usage + + has 'security_salt' => (is=>'ro', required=>1, isa=>'Str'); + has_field 'recaptcha' => ( + type=>'reCAPTCHA', + public_key=>'[YOUR PUBLIC KEY]', + private_key=>'[YOUR PRIVATE KEY]', + security_salt=>sub { + my ($self, $field) = @_; + return $self->security_salt; + }, + required=>1, + ); =head1 DESCRIPTION -Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. +Uses L<Captcha::reCAPTCHA> to add a "Check if the agent is human" field. You +will need an account from http://recaptcha.net/ to make this work. + +=head1 FIELD OPTIONS + +We support the following additional field options, over what is inherited from +L<HTML::FormHandler::Field> + +=head2 public_key + +The public key you get when you create an account on http://recaptcha.net/ + +=head2 private_key + +The private key you get when you create an account on http://recaptcha.net/ + +=head2 security_salt + +Sometimes your user may properly validate recaptcha, but input an invald an +response to some other field. Accordingly, we support the idea that once the +reCAPTCHA is validated, you can supply a private 'salt' which makes the field +as valid for a certain set of requests. You need to manage this in the code +that is calling the form object. See the SYNOPSIS example for an easy way to +do this in L<Catalyst> with L<Catalyst::Plugin::Session> install. =head1 SEE ALSO The following modules or resources may be of interest. L<HTML::FormHandler>, L<Captch::reCAPTCHA> =head1 AUTHOR John Napiorkowski C<< <[email protected]> >> =head1 COPYRIGHT & LICENSE Copyright 2010, John Napiorkowski C<< <[email protected]> >> Original work sponsered by Shutterstock, LLC. <<a href="http://shutterstock.com/">http://shutterstock.com</a>> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; use namespace::autoclean; 1; diff --git a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm index 142e6a4..948b389 100644 --- a/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm +++ b/lib/HTML/FormHandlerX/Widget/Field/reCAPTCHA.pm @@ -1,23 +1,23 @@ package HTML::FormHandler::Widget::Field::reCAPTCHA; use Moose::Role; sub render { my ( $self, $result ) = @_; $result ||= $self->result; if($self->validated) { - my $security_salt = $self->security_salt; + my $security_salt = $self->security_salt->($self->parent->form, $self); return <<"END"; <input type='hidden' name='recaptcha_response_field' value='$security_salt' /> <input type='hidden' name='recaptcha_already_validated' value='1' /> END } else { my @args = $self->prepare_public_recaptcha_args; my $output = $self->recaptcha_instance->get_html(@args); return $self->wrap_field( $result, $output ); } } use namespace::autoclean; 1;
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
ba81a1df489f7792629ac52add37a3d71c2e9ade
add README
diff --git a/README b/README new file mode 100644 index 0000000..5fe64ba --- /dev/null +++ b/README @@ -0,0 +1,23 @@ +NAME + HTML::FormHandler::Field::reCAPTCHA - Add a Captcha::reCAPTCHA field + +DESCRIPTION + Uses Captcha::reCAPTCHA to add a "Check if the agent is human" field. + +SEE ALSO + The following modules or resources may be of interest. + + HTML::FormHandler, Captch::reCAPTCHA + +AUTHOR + John Napiorkowski "<[email protected]>" + +COPYRIGHT & LICENSE + Copyright 2010, John Napiorkowski "<[email protected]>" + + Original work sponsered by Shutterstock, LLC. <<a + href="http://shutterstock.com/">http://shutterstock.com</a>> + + This program is free software; you can redistribute it and/or modify it + under the same terms as Perl itself. +
jjn1056/HTML-FormHandlerX-Field-reCAPTCHA
221d665ef2a2e233afd55052ecdc314d35ab4e64
adding some files
diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..0faaf15 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,14 @@ +use inc::Module::Install 0.91; + +use warnings; +use strict; + +all_from 'lib/HTML/FormHandlerX/Field/reCAPTCHA.pm'; +repository 'git://github.com/jjn1056/Test-DBIx-Class.git'; + +requires 'HTML::FormHandler' => '0.30001'; +test_requires 'Test::More' => '0.94'; + +auto_install; +tests_recursive; +WriteAll;
cvpcs/android_external_vixie-cron
572e15242f2f0150942ed6653d7b54c9af03421f
removed unneccessary limit on build tags
diff --git a/Android.mk b/Android.mk index 82c1491..dba16d1 100644 --- a/Android.mk +++ b/Android.mk @@ -1,20 +1,18 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:=\ database.c do_command.c \ entry.c env.c job.c misc.c \ popen.c pw_dup.c user.c cron.c LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) -LOCAL_MODULE_TAGS := eng LOCAL_MODULE := cron include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_SRC_FILES:=\ misc.c entry.c env.c \ pw_dup.c crontab.c LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) -LOCAL_MODULE_TAGS := eng LOCAL_MODULE := crontab include $(BUILD_EXECUTABLE)
cvpcs/android_external_vixie-cron
d0b71b7cd529902ac1e1cd27c285f3708ea11054
Added an android makefile to the build
diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..82c1491 --- /dev/null +++ b/Android.mk @@ -0,0 +1,20 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES:=\ + database.c do_command.c \ + entry.c env.c job.c misc.c \ + popen.c pw_dup.c user.c cron.c +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := eng +LOCAL_MODULE := cron +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES:=\ + misc.c entry.c env.c \ + pw_dup.c crontab.c +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := eng +LOCAL_MODULE := crontab +include $(BUILD_EXECUTABLE)
z00100/iPhonebook
22acf1d1c108f1bd2cfc75d535deee6f4a454a24
Fixed message
diff --git a/README b/README index 84362ca..e228113 100644 --- a/README +++ b/README @@ -1 +1 @@ -Test file \ No newline at end of file +Test file blah blah \ No newline at end of file
z00100/iPhonebook
f379e44e6f99ee7d569405d6afc758b562a9e116
Added some content
diff --git a/README b/README index e69de29..84362ca 100644 --- a/README +++ b/README @@ -0,0 +1 @@ +Test file \ No newline at end of file
ayax79/jive-dev
bd85d4df10514dc322f0a039fab7d8064d8b3071
outputting stuff working correctly.
diff --git a/script-plugin/src/main/plugin/resources/templates/script-console.ftl b/script-plugin/src/main/plugin/resources/templates/script-console.ftl index ec3ceb2..1956418 100644 --- a/script-plugin/src/main/plugin/resources/templates/script-console.ftl +++ b/script-plugin/src/main/plugin/resources/templates/script-console.ftl @@ -1,52 +1,76 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Script Console</title> <meta name="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="<@s.url value='/plugins/script-plugin/resources/script/jquery-1.4.2.min.js' />"></script> <script type="text/javascript"> + var push_script = function() { + $.post('<@s.url action="script-console" method="process" />', { script: $('#input-box').val() }, + function(data) { + var result = data.result; + if (result) { + $('#output-box').append('<li class="result-msg console-msg">result: ' + result + '</li>'); + } + + var output = data.output; + if (output) { + $('#output-box').append('<li class="output-msg console-msg">output: ' + output + '</li>'); + } + + var error = data.error; + if (error) { + $("#output-box").append('<li class="error-msg console-msg">error: ' + error + '</li>'); + } + }, "json"); + }; + + $(function() { - var push_script = function() { - $.post('<@s.url action="script-console" method="process" />', { script: $('#input-box').val() }, - function(data) { - $('#output-box').append("> " + data.msg + "<br />"); - }, "json"); - }; $('#submit-script').click(push_script); }); </script> <style type="text/css"> #output-box { outline: 1px solid black; width: 800px; height: 400px; margin-top: 10px; padding: 3px 3px 3px 3px; } + + .console-msg { + list-style-type: none; + font-weight: bold; + } + + .error-msg { + color: red; + } </style> </head> <body> <h1>Jive Script Console</h1> <div id="input-box-container"> <textarea id="input-box" rows="25" cols="100"></textarea> </div> <button id="submit-script">Submit</button> <div id="output-box"></div> <div id="help-box"> <ul> - ${action.help} + ${action.help} </ul> </div> </body> </html> diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala index 67e9390..5cb2f9e 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala @@ -1,51 +1,58 @@ package com.syncapse.plugin.script import com.syncapse.jive.Loggable import java.lang.String import javax.script._ +import java.io.{PrintWriter, StringWriter, Writer} trait ScriptType { def name: String; } object ScriptType { - case object ECMA_SCRIPT extends ScriptType {def name = "ECMAScript"} + case object JAVA_SCRIPT extends ScriptType {def name = "JavaScript"} def getScriptType(name: String): ScriptType = name match { - case "ECMAScript" => ECMA_SCRIPT.asInstanceOf[ScriptType] + case "JavaScript" => JAVA_SCRIPT.asInstanceOf[ScriptType] } } -case class ScriptResult(msg: String) -case class ErrorResult(msg: String) +case class ScriptResult(result: Option[String], output: String, error: String) +case class ErrorResult(error: String) object ScriptRunner extends Loggable { protected lazy val engineManager = new ScriptEngineManager(); def execute(scriptType: ScriptType, script: String, bindings: Map[String, AnyRef]): Either[ErrorResult, ScriptResult] = { val engine = engineManager.getEngineByName(scriptType.name) if (engine != null) { try { - val b = buidBindings(bindings) - val result = engine.eval(script, b).toString - Right(ScriptResult(result)) + val stdOut = new StringWriter + val stdErr = new StringWriter + + val c = engine.getContext + c.setWriter(new PrintWriter(stdOut)) + c.setErrorWriter(new PrintWriter(stdErr)) + + bindings foreach {case (key, value) => c.setAttribute(key, value, ScriptContext.ENGINE_SCOPE)} + val result = engine.eval(script) + + if (result != null) { + Right(ScriptResult(Some(result.toString), stdOut.toString, stdErr.toString)) + } + else { + Right(ScriptResult(None, stdOut.toString, stdErr.toString)) + } } catch { - case e: ScriptException => + case e: Throwable => logger.warn(e.getMessage, e) Left(ErrorResult(e.getMessage)) } } else { logger.warn("Could not determine engine, not executing script") Left(ErrorResult("Could not determine engine, not executing script")) } } - protected def buidBindings(map: Map[String, AnyRef]): Bindings = { - val bindings: SimpleBindings = new SimpleBindings - // must add this way to ensure that the backing map is mutable - map foreach { case (key, value) => bindings.put(key, value) } - bindings - } - } \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala index 32a5e1e..4b62902 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -1,42 +1,45 @@ package com.syncapse.plugin.script.action import com.opensymphony.xwork2.Action import reflect.BeanProperty import java.io.{ByteArrayInputStream, InputStream} import com.twitter.json.Json import com.jivesoftware.community.action.util.Decorate import com.jivesoftware.community.action.JiveActionSupport import com.syncapse.plugin.script._ import org.springframework.web.context.support.WebApplicationContextUtils @Decorate(false) class ScriptAction extends JiveActionSupport { @BeanProperty var script: String = null @BeanProperty - var scriptType: String = ScriptType.ECMA_SCRIPT.name + var scriptType: String = ScriptType.JAVA_SCRIPT.name @BeanProperty var scriptResult: InputStream = null override def execute = { Action.SUCCESS } def process: String = { val sType = ScriptType.getScriptType(scriptType) val json = asJSON(ScriptRunner.execute(sType, script, BindingUtil.buildBindingMap(WebApplicationContextUtils.getWebApplicationContext(getRequest.getSession.getServletContext)))) scriptResult = new ByteArrayInputStream(json.toString.getBytes("UTF-8")) "json" } def getHelp = BindingUtil.buildHelp protected def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { case Left(ErrorResult(msg)) => Json.build(Map("msg" -> msg)) - case Right(ScriptResult(msg)) => Json.build(Map("msg" -> msg)) + case Right(ScriptResult(result, output, error)) => result match { + case Some(s) => Json.build(Map("result" -> s, "output" -> output, "error" -> error)); + case None => Json.build(Map("output" -> output, "error" -> error)) + } } } \ No newline at end of file diff --git a/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala b/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala index 5f1a95c..d32fb11 100644 --- a/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala +++ b/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala @@ -1,51 +1,52 @@ package com.syncapse.plugin.script import org.specs.mock.Mockito import org.specs.Specification import org.specs.runner.JUnit4 import com.jivesoftware.base.UserManager import com.jivesoftware.base.aaa.AuthenticationProvider import com.jivesoftware.community._ +import org.springframework.web.context.WebApplicationContext class BindingUtilSpec extends JUnit4(BindingUtilSpec) object BindingUtilSpec extends Specification with Mockito { "BindingUtil" should { "build help" in { val help = BindingUtil.buildHelp help must include("<li>") help must include("</li>") help must include("um") } - "build binginds map" in { - val ctx = mock[JiveContext] - ctx.getUserManager returns mock[UserManager] - ctx.getAuthenticationProvider returns mock[AuthenticationProvider] - ctx.getActivityManager returns mock[ActivityManager] - ctx.getAnnouncementManager returns mock[AnnouncementManager] - ctx.getCommunityManager returns mock[CommunityManager] - ctx.getForumManager returns mock[ForumManager] + "build bingings map" in { + val ctx = mock[WebApplicationContext] + ctx.getBean("userManagerImpl") returns mock[UserManager] + ctx.getBean("authenticationProvider") returns mock[AuthenticationProvider] + ctx.getBean("activityManagerImpl") returns mock[ActivityManager] + ctx.getBean("announcementManagerImpl") returns mock[AnnouncementManager] + ctx.getBean("communityManagerImpl") returns mock[CommunityManager] + ctx.getBean("forumManagerImpl") returns mock[ForumManager] val map = BindingUtil.buildBindingMap(ctx) map must haveKey("ctx") map must haveValue(ctx) map must haveKey("um") map must haveKey("cm") map must haveKey("ap") map must haveKey("acm") map must haveKey("anm") map must haveKey("fm") - there was atLeastOne(ctx).getUserManager - there was atLeastOne(ctx).getAuthenticationProvider - there was atLeastOne(ctx).getActivityManager - there was atLeastOne(ctx).getAnnouncementManager - there was atLeastOne(ctx).getCommunityManager - there was atLeastOne(ctx).getForumManager + there was atLeastOne(ctx).getBean("userManagerImpl") + there was atLeastOne(ctx).getBean("authenticationProvider") + there was atLeastOne(ctx).getBean("activityManagerImpl") + there was atLeastOne(ctx).getBean("announcementManagerImpl") + there was atLeastOne(ctx).getBean("communityManagerImpl") + there was atLeastOne(ctx).getBean("forumManagerImpl") } } } \ No newline at end of file diff --git a/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala b/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala index 9783917..01a75d6 100644 --- a/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala +++ b/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala @@ -1,18 +1,28 @@ package com.syncapse.plugin.script import org.specs.Specification import org.specs.mock.Mockito import org.specs.runner.JUnit4 class ScriptRunnerTest extends JUnit4(ScriptRunnerSpec) object ScriptRunnerSpec extends Specification with Mockito { "ScriptRunner" should { "be 2 " in { - ScriptRunner.execute(ScriptType.ECMA_SCRIPT, "1 + 1;", Map.empty) match { + ScriptRunner.execute(ScriptType.JAVA_SCRIPT, "1 + 1;", Map.empty) match { case Left(error) => fail("Should not have an error") - case Right(result) => result.msg must beEqual("2.0"); + case Right(result) => result.result match { + case Some(x) => x must beEqual("2.0"); + case None => fail("should have output") + } + } + } + + "handle print" in { + ScriptRunner.execute(ScriptType.JAVA_SCRIPT, "print(\"hi\");", Map.empty) match { + case Left(error) => fail("should not of failed") + case Right(result) => result must notBeNull } } } } \ No newline at end of file
ayax79/jive-dev
5c30830d06fab8b9d1608ba2f1f4785d9f803b92
added jive properties.
diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala index cada131..b9cce01 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala @@ -1,22 +1,25 @@ package com.syncapse.plugin.script -import com.jivesoftware.community.JiveContext +import org.springframework.web.context.WebApplicationContext + object BindingUtil { - protected lazy val entries = List[(String, String, JiveContext => AnyRef)]( + protected lazy val entries = List[(String, String, WebApplicationContext => AnyRef)]( (" ctx: Jive Context", "ctx", {jc => jc}), - (" ap: Authentication Provider", "ap", {jc => jc.getAuthenticationProvider}), - (" acm: Activity Manager", "acm", {jc => jc.getActivityManager}), - (" anm: Announcement Manager", "anm", {jc => jc.getAnnouncementManager}), - (" cm: CommunityManager", "cm", {jc => jc.getCommunityManager}), - (" fm: ForumManager", "fm", {jc => jc.getForumManager}), - (" um: UserManager", "um", {jc => jc.getUserManager})) + (" ap: Authentication Provider", "ap", {jc => jc.getBean("authenticationProvider")}), + (" acm: Activity Manager", "acm", {jc => jc.getBean("activityManagerImpl")}), + (" anm: Announcement Manager", "anm", {jc => jc.getBean("announcementManagerImpl")}), + (" cm: CommunityManager", "cm", {jc => jc.getBean("communityManagerImpl")}), + (" fm: ForumManager", "fm", {jc => jc.getBean("forumManagerImpl")}), + (" um: UserManager", "um", {jc => jc.getBean("userManagerImpl")}), + (" jp: jive properties", "jp", {jc => jc.getBean("jiveProperties")}) + ) - def buildBindingMap(ctx: JiveContext): Map[String, AnyRef] = entries map { case (_, name, f) => (name, f(ctx))} toMap + def buildBindingMap(ctx: WebApplicationContext): Map[String, AnyRef] = entries map {case (_, name, f) => (name, f(ctx))} toMap def buildHelp = { val builder = new StringBuilder entries foreach {case (desc, _, _) => builder ++= "<li>" ++= desc ++= "</li>"} builder.toString } } \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala index 6254529..32a5e1e 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -1,40 +1,42 @@ package com.syncapse.plugin.script.action import com.opensymphony.xwork2.Action import reflect.BeanProperty import java.io.{ByteArrayInputStream, InputStream} import com.twitter.json.Json import com.jivesoftware.community.action.util.Decorate import com.jivesoftware.community.action.JiveActionSupport import com.syncapse.plugin.script._ +import org.springframework.web.context.support.WebApplicationContextUtils @Decorate(false) class ScriptAction extends JiveActionSupport { @BeanProperty var script: String = null @BeanProperty var scriptType: String = ScriptType.ECMA_SCRIPT.name @BeanProperty var scriptResult: InputStream = null override def execute = { Action.SUCCESS } def process: String = { val sType = ScriptType.getScriptType(scriptType) - val json = asJSON(ScriptRunner.execute(sType, script, BindingUtil.buildBindingMap(getJiveContext))) + val json = asJSON(ScriptRunner.execute(sType, script, + BindingUtil.buildBindingMap(WebApplicationContextUtils.getWebApplicationContext(getRequest.getSession.getServletContext)))) scriptResult = new ByteArrayInputStream(json.toString.getBytes("UTF-8")) "json" } def getHelp = BindingUtil.buildHelp protected def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { case Left(ErrorResult(msg)) => Json.build(Map("msg" -> msg)) case Right(ScriptResult(msg)) => Json.build(Map("msg" -> msg)) } } \ No newline at end of file
ayax79/jive-dev
e45931e927752bf0bdca566e280936f7db099525
more work implementing.
diff --git a/script-plugin/src/main/plugin/resources/templates/script-console.ftl b/script-plugin/src/main/plugin/resources/templates/script-console.ftl index 3886ad4..ec3ceb2 100644 --- a/script-plugin/src/main/plugin/resources/templates/script-console.ftl +++ b/script-plugin/src/main/plugin/resources/templates/script-console.ftl @@ -1,74 +1,52 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> + "http://www.w3.org/TR/html4/strict.dtd"> <html> - <head> +<head> <title>Script Console</title> <meta name="Content-Type" content="text/html; charset=UTF-8"> - <script type="text/javascript" src="<@s.url value='/plugins/script-plugin/resources/script/jquery-1.4.2.min.js' />"></script> - <script type="text/javascript" src="<@s.url value='/plugins/script-plugin/resources/script/jquery.console.js' />"></script> - <!-- Everything beyond this point is user-customized --> + <script type="text/javascript" + src="<@s.url value='/plugins/script-plugin/resources/script/jquery-1.4.2.min.js' />"></script> + <script type="text/javascript"> - $(document).ready(function(){ - /* First console */ - var console1 = $('<div class="console1">'); - $('body').append(console1); - var controller1 = console1.console({ - promptLabel: 'Demo> ', - commandValidate:function(line){ - if (line == "") return false; - else return true; - }, - commandHandle:function(line, report){ - try { - $.post('<@s.url action="script-console" method="process" />', - { script: line }, function(data) { - report([ - {msg: " => " + data.msg, className:"jquery-console-message-value"} - ]); - }, "json"); - } catch (e) { - return e.toString(); - } - }, - autofocus:true, - animateScroll:true, - promptHistory:true, - charInsertTrigger:function(keycode,line){ - // Let you type until you press a-z - // Never allow zero. - return !line.match(/[a-z]+/) && keycode != '0'.charCodeAt(0); - } - }); - }); + $(function() { + + var push_script = function() { + $.post('<@s.url action="script-console" method="process" />', { script: $('#input-box').val() }, + function(data) { + $('#output-box').append("> " + data.msg + "<br />"); + }, "json"); + }; + + $('#submit-script').click(push_script); + }); + </script> - <style type="text/css" media="screen"> - /* First console */ - div.console1 { font-size: 14px } - div.console1 div.jquery-console-inner - { width:900px; height:200px; background:#333; padding:0.5em; - overflow:auto } - div.console1 div.jquery-console-prompt-box - { color:#fff; font-family:monospace; } - div.console1 div.jquery-console-focus span.jquery-console-cursor - { background:#fefefe; color:#333; font-weight:bold } - div.console1 div.jquery-console-message-error - { color:#ef0505; font-family:sans-serif; font-weight:bold; - padding:0.1em; } - div.console1 div.jquery-console-message-value - { color:#1ad027; font-family:monospace; - padding:0.1em; } - div.console1 div.jquery-console-message-type - { color:#52666f; font-family:monospace; - padding:0.1em; } - div.console1 span.jquery-console-prompt-label { font-weight:bold } + <style type="text/css"> + #output-box { + outline: 1px solid black; + width: 800px; + height: 400px; + margin-top: 10px; + padding: 3px 3px 3px 3px; + } </style> - </head> - <body> - <noscript> - <p> - <strong>Please enable JavaScript or upgrade your browser.</strong> - </p> - </noscript> - <h1>Jive Script Console</h1> - </body> + +</head> +<body> +<h1>Jive Script Console</h1> + +<div id="input-box-container"> + <textarea id="input-box" rows="25" cols="100"></textarea> +</div> +<button id="submit-script">Submit</button> + +<div id="output-box"></div> + +<div id="help-box"> + <ul> + ${action.help} + </ul> +</div> + +</body> </html> diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala new file mode 100644 index 0000000..cada131 --- /dev/null +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/BindingUtil.scala @@ -0,0 +1,22 @@ +package com.syncapse.plugin.script + +import com.jivesoftware.community.JiveContext +object BindingUtil { + protected lazy val entries = List[(String, String, JiveContext => AnyRef)]( + (" ctx: Jive Context", "ctx", {jc => jc}), + (" ap: Authentication Provider", "ap", {jc => jc.getAuthenticationProvider}), + (" acm: Activity Manager", "acm", {jc => jc.getActivityManager}), + (" anm: Announcement Manager", "anm", {jc => jc.getAnnouncementManager}), + (" cm: CommunityManager", "cm", {jc => jc.getCommunityManager}), + (" fm: ForumManager", "fm", {jc => jc.getForumManager}), + (" um: UserManager", "um", {jc => jc.getUserManager})) + + def buildBindingMap(ctx: JiveContext): Map[String, AnyRef] = entries map { case (_, name, f) => (name, f(ctx))} toMap + + def buildHelp = { + val builder = new StringBuilder + entries foreach {case (desc, _, _) => builder ++= "<li>" ++= desc ++= "</li>"} + builder.toString + } + +} \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala index 59629af..67e9390 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala @@ -1,52 +1,51 @@ package com.syncapse.plugin.script import com.syncapse.jive.Loggable -import java.io.{Writer, StringWriter} import java.lang.String import javax.script._ trait ScriptType { def name: String; } object ScriptType { case object ECMA_SCRIPT extends ScriptType {def name = "ECMAScript"} def getScriptType(name: String): ScriptType = name match { case "ECMAScript" => ECMA_SCRIPT.asInstanceOf[ScriptType] } } case class ScriptResult(msg: String) case class ErrorResult(msg: String) object ScriptRunner extends Loggable { protected lazy val engineManager = new ScriptEngineManager(); def execute(scriptType: ScriptType, script: String, bindings: Map[String, AnyRef]): Either[ErrorResult, ScriptResult] = { val engine = engineManager.getEngineByName(scriptType.name) if (engine != null) { try { val b = buidBindings(bindings) val result = engine.eval(script, b).toString Right(ScriptResult(result)) } catch { case e: ScriptException => logger.warn(e.getMessage, e) Left(ErrorResult(e.getMessage)) } } else { logger.warn("Could not determine engine, not executing script") Left(ErrorResult("Could not determine engine, not executing script")) } } protected def buidBindings(map: Map[String, AnyRef]): Bindings = { - val bindings = new SimpleBindings + val bindings: SimpleBindings = new SimpleBindings + // must add this way to ensure that the backing map is mutable map foreach { case (key, value) => bindings.put(key, value) } bindings } - } \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala index 830cf42..6254529 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -1,45 +1,40 @@ package com.syncapse.plugin.script.action import com.opensymphony.xwork2.Action import reflect.BeanProperty -import com.syncapse.plugin.script.{ScriptResult, ErrorResult, ScriptType, ScriptRunner} import java.io.{ByteArrayInputStream, InputStream} import com.twitter.json.Json import com.jivesoftware.community.action.util.Decorate -import org.springframework.web.context.support.{WebApplicationContextUtils, XmlWebApplicationContext} import com.jivesoftware.community.action.JiveActionSupport +import com.syncapse.plugin.script._ @Decorate(false) class ScriptAction extends JiveActionSupport { @BeanProperty var script: String = null @BeanProperty var scriptType: String = ScriptType.ECMA_SCRIPT.name @BeanProperty var scriptResult: InputStream = null override def execute = { Action.SUCCESS } def process: String = { val sType = ScriptType.getScriptType(scriptType) - val json = asJSON(ScriptRunner.execute(sType, script, buildBindingMap)) + val json = asJSON(ScriptRunner.execute(sType, script, BindingUtil.buildBindingMap(getJiveContext))) scriptResult = new ByteArrayInputStream(json.toString.getBytes("UTF-8")) "json" } + def getHelp = BindingUtil.buildHelp + protected def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { case Left(ErrorResult(msg)) => Json.build(Map("msg" -> msg)) case Right(ScriptResult(msg)) => Json.build(Map("msg" -> msg)) } - protected def buildBindingMap: Map[String, AnyRef] = { - val ctx = WebApplicationContextUtils.getWebApplicationContext(getRequest.getSession.getServletContext).asInstanceOf[XmlWebApplicationContext] - ctx.getBeanDefinitionNames.map( k => (k, ctx.getBean(k))).toMap - } - - } \ No newline at end of file diff --git a/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala b/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala new file mode 100644 index 0000000..5f1a95c --- /dev/null +++ b/script-plugin/src/test/scala/com/syncapse/plugin/script/BindingUtilSpec.scala @@ -0,0 +1,51 @@ +package com.syncapse.plugin.script + +import org.specs.mock.Mockito +import org.specs.Specification +import org.specs.runner.JUnit4 +import com.jivesoftware.base.UserManager +import com.jivesoftware.base.aaa.AuthenticationProvider +import com.jivesoftware.community._ + +class BindingUtilSpec extends JUnit4(BindingUtilSpec) +object BindingUtilSpec extends Specification with Mockito { + + "BindingUtil" should { + "build help" in { + val help = BindingUtil.buildHelp + help must include("<li>") + help must include("</li>") + help must include("um") + } + + "build binginds map" in { + val ctx = mock[JiveContext] + ctx.getUserManager returns mock[UserManager] + ctx.getAuthenticationProvider returns mock[AuthenticationProvider] + ctx.getActivityManager returns mock[ActivityManager] + ctx.getAnnouncementManager returns mock[AnnouncementManager] + ctx.getCommunityManager returns mock[CommunityManager] + ctx.getForumManager returns mock[ForumManager] + + val map = BindingUtil.buildBindingMap(ctx) + + map must haveKey("ctx") + map must haveValue(ctx) + map must haveKey("um") + map must haveKey("cm") + map must haveKey("ap") + map must haveKey("acm") + map must haveKey("anm") + map must haveKey("fm") + + there was atLeastOne(ctx).getUserManager + there was atLeastOne(ctx).getAuthenticationProvider + there was atLeastOne(ctx).getActivityManager + there was atLeastOne(ctx).getAnnouncementManager + there was atLeastOne(ctx).getCommunityManager + there was atLeastOne(ctx).getForumManager + } + + } + +} \ No newline at end of file
ayax79/jive-dev
5003219045a4f0d56ca017cf44369ec444c70a2c
more work implementing
diff --git a/.gitignore b/.gitignore index 1965d64..7f351d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ web/target script-plugin/target *.iml *.ipr *.iws web/overlays +target diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala index 218ca36..59629af 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala @@ -1,53 +1,52 @@ package com.syncapse.plugin.script import com.syncapse.jive.Loggable import java.io.{Writer, StringWriter} import java.lang.String import javax.script._ trait ScriptType { def name: String; } object ScriptType { - case object ECMA_SCRIPT extends ScriptType { def name = "ECMAScript" } + case object ECMA_SCRIPT extends ScriptType {def name = "ECMAScript"} def getScriptType(name: String): ScriptType = name match { case "ECMAScript" => ECMA_SCRIPT.asInstanceOf[ScriptType] } } case class ScriptResult(msg: String) case class ErrorResult(msg: String) object ScriptRunner extends Loggable { protected lazy val engineManager = new ScriptEngineManager(); - def execute(scriptType: ScriptType, script: String): Either[ErrorResult, ScriptResult] = { + def execute(scriptType: ScriptType, script: String, bindings: Map[String, AnyRef]): Either[ErrorResult, ScriptResult] = { val engine = engineManager.getEngineByName(scriptType.name) - if (engine != null) { + if (engine != null) { try { - val writer = new StringWriter - val ctx = buildContext(writer) - val result = engine.eval(script, ctx).toString + val b = buidBindings(bindings) + val result = engine.eval(script, b).toString Right(ScriptResult(result)) } catch { case e: ScriptException => logger.warn(e.getMessage, e) Left(ErrorResult(e.getMessage)) } } else { logger.warn("Could not determine engine, not executing script") Left(ErrorResult("Could not determine engine, not executing script")) } } - protected def buildContext(writer: Writer): ScriptContext = { - val context = new SimpleScriptContext - context.setWriter(writer) - context.setErrorWriter(writer) - context + protected def buidBindings(map: Map[String, AnyRef]): Bindings = { + val bindings = new SimpleBindings + map foreach { case (key, value) => bindings.put(key, value) } + bindings } + } \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala index 5adb8bf..830cf42 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -1,37 +1,45 @@ package com.syncapse.plugin.script.action -import com.opensymphony.xwork2.{Action, ActionSupport} +import com.opensymphony.xwork2.Action import reflect.BeanProperty import com.syncapse.plugin.script.{ScriptResult, ErrorResult, ScriptType, ScriptRunner} import java.io.{ByteArrayInputStream, InputStream} import com.twitter.json.Json import com.jivesoftware.community.action.util.Decorate +import org.springframework.web.context.support.{WebApplicationContextUtils, XmlWebApplicationContext} +import com.jivesoftware.community.action.JiveActionSupport @Decorate(false) -class ScriptAction extends ActionSupport { +class ScriptAction extends JiveActionSupport { @BeanProperty var script: String = null @BeanProperty var scriptType: String = ScriptType.ECMA_SCRIPT.name @BeanProperty var scriptResult: InputStream = null override def execute = { Action.SUCCESS } def process: String = { val sType = ScriptType.getScriptType(scriptType) - val json = asJSON(ScriptRunner.execute(sType, script)) + val json = asJSON(ScriptRunner.execute(sType, script, buildBindingMap)) scriptResult = new ByteArrayInputStream(json.toString.getBytes("UTF-8")) "json" } - def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { + protected def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { case Left(ErrorResult(msg)) => Json.build(Map("msg" -> msg)) case Right(ScriptResult(msg)) => Json.build(Map("msg" -> msg)) } + protected def buildBindingMap: Map[String, AnyRef] = { + val ctx = WebApplicationContextUtils.getWebApplicationContext(getRequest.getSession.getServletContext).asInstanceOf[XmlWebApplicationContext] + ctx.getBeanDefinitionNames.map( k => (k, ctx.getBean(k))).toMap + } + + } \ No newline at end of file diff --git a/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala b/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala index 0f569a1..9783917 100644 --- a/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala +++ b/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala @@ -1,18 +1,18 @@ package com.syncapse.plugin.script import org.specs.Specification import org.specs.mock.Mockito import org.specs.runner.JUnit4 class ScriptRunnerTest extends JUnit4(ScriptRunnerSpec) object ScriptRunnerSpec extends Specification with Mockito { "ScriptRunner" should { "be 2 " in { - ScriptRunner.execute(ScriptType.ECMA_SCRIPT, "1 + 1;") match { + ScriptRunner.execute(ScriptType.ECMA_SCRIPT, "1 + 1;", Map.empty) match { case Left(error) => fail("Should not have an error") case Right(result) => result.msg must beEqual("2.0"); } } } } \ No newline at end of file
ayax79/jive-dev
703b658a31301d8dff2bafbfdcf6394e57b82494
Actually got the script to run.
diff --git a/script-plugin/pom.xml b/script-plugin/pom.xml index b413fb4..5a7acfe 100644 --- a/script-plugin/pom.xml +++ b/script-plugin/pom.xml @@ -1,199 +1,225 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ~ $Revision: 96475 $ ~ $Date: 2009-11-02 16:51:02 -0800 (Mon, 02 Nov 2009) $ ~ ~ Copyright (C) 1999-${YEAR} Jive Software. All rights reserved. ~ ~ This software is the proprietary information of Jive Software. Use is subject to license terms. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- These parameters were pased in via the commandline when this pom was created by the archetype. --> <modelVersion>4.0.0</modelVersion> <groupId>com.syncapse.jive</groupId> <artifactId>script-plugin-plugin</artifactId> <name>script-plugin</name> <version>1.0</version> <packaging>jar</packaging> <url>http://www.jivesoftware.com</url> <build> <finalName>script-plugin-plugin-${sbs.version}-${version}</finalName> <sourceDirectory>src/main/scala</sourceDirectory> <testSourceDirectory>src/test/scala</testSourceDirectory> <plugins> <!-- For compilation--> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- Weave transactions into the plugin --> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-5</version> <executions> <execution> <id>assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>${basedir}/src/main/assembly/assembly-plugin.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.scala-tools</groupId> <artifactId>maven-scala-plugin</artifactId> <executions> <execution> <goals> <goal>compile</goal> <goal>testCompile</goal> </goals> </execution> </executions> <configuration> <scalaVersion>${scala.version}</scalaVersion> <args> <arg>-target:jvm-1.5</arg> </args> </configuration> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <!-- Unpackages this SBS plugin. That way it can be used in conjunction with the -DpluginDirs= property, which bypasses the standard plugin installation (which happens via the admin console), by pointing to exploded plugin jar created by this. --> <id>explode-sbs-plugin</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <mkdir dir="${basedir}/target/script-plugin-${sbs.version}-${version}"/> <unjar src="${basedir}/target/script-plugin-plugin-${sbs.version}-${version}.jar" dest="${basedir}/target/script-plugin-${sbs.version}-${version}"/> </tasks> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <phase>verify</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- For unit testing --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <downloadSources>true</downloadSources> <buildcommands> <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand> </buildcommands> <additionalProjectnatures> <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature> </additionalProjectnatures> <classpathContainers> <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer> </classpathContainers> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-deps-for-jrebel</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <excludeScope>provided</excludeScope> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>com.syncapse</groupId> <artifactId>jive-scala</artifactId> <version>1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee</artifactId> <version>${sbs.version}</version> <type>jar</type> <scope>provided</scope> </dependency> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee-all</artifactId> <version>${sbs.version}</version> <type>pom</type> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.3</version> <type>jar</type> <scope>provided</scope> </dependency> <!-- The following dependencies are for unit testing--> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version> </dependency> + <dependency> + <groupId>com.twitter</groupId> + <artifactId>json</artifactId> + <version>2.1.3</version> + </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> <scope>test</scope> </dependency> <dependency> <groupId>org.specs</groupId> <artifactId>specs</artifactId> - <version>1.2.5</version> + <version>1.6.5</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-all</artifactId> + <version>1.8.5</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-all</artifactId> + <version>1.2</version> <scope>test</scope> </dependency> </dependencies> <!-- This is where you set the Jive SBS version your plugin is compiled against. --> <properties> <sbs.version>4.5.1</sbs.version> <scala.version>2.8.0</scala.version> </properties> + + + <repositories> + <repository> + <id>scala-tools.org</id> + <url>http://nexus.scala-tools.org/content/repositories/releases/</url> + </repository> + </repositories> + </project> diff --git a/script-plugin/src/main/plugin/resources/templates/script-console.ftl b/script-plugin/src/main/plugin/resources/templates/script-console.ftl index 302b6e9..3886ad4 100644 --- a/script-plugin/src/main/plugin/resources/templates/script-console.ftl +++ b/script-plugin/src/main/plugin/resources/templates/script-console.ftl @@ -1,205 +1,74 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> - <title>JQuery Console Demo</title> + <title>Script Console</title> <meta name="Content-Type" content="text/html; charset=UTF-8"> - <script type="text/javascript" src="jquery-1.4.2.min.js"></script> - <script type="text/javascript" src="jquery.console.js"></script> + <script type="text/javascript" src="<@s.url value='/plugins/script-plugin/resources/script/jquery-1.4.2.min.js' />"></script> + <script type="text/javascript" src="<@s.url value='/plugins/script-plugin/resources/script/jquery.console.js' />"></script> <!-- Everything beyond this point is user-customized --> <script type="text/javascript"> $(document).ready(function(){ /* First console */ var console1 = $('<div class="console1">'); $('body').append(console1); var controller1 = console1.console({ promptLabel: 'Demo> ', commandValidate:function(line){ if (line == "") return false; else return true; }, - commandHandle:function(line){ -// return [{msg:"=> [12,42]", -// className:"jquery-console-message-value"}, -// {msg:":: [a]", -// className:"jquery-console-message-type"}] - - + commandHandle:function(line, report){ try { $.post('<@s.url action="script-console" method="process" />', { script: line }, function(data) { report([ {msg: " => " + data.msg, className:"jquery-console-message-value"} ]); }, "json"); } catch (e) { return e.toString(); } }, autofocus:true, animateScroll:true, promptHistory:true, charInsertTrigger:function(keycode,line){ // Let you type until you press a-z // Never allow zero. return !line.match(/[a-z]+/) && keycode != '0'.charCodeAt(0); } }); - /* Second console */ - var console2 = $('<div class="console2">'); - $('body').append(console2); - var controller2 = console2.console({ - promptLabel: 'JavaScript> ', - commandValidate:function(line){ - if (line == "") return false; - else return true; - }, - commandHandle:function(line){ - try { var ret = eval(line); - if (typeof ret != 'undefined') return ret.toString(); - else return true; } - catch (e) { return e.toString(); } - }, - animateScroll:true, - promptHistory:true, - welcomeMessage:'Enter some expressions to evaluate.' - }); - controller2.promptText('5 * 4'); - /* Third console */ - var console3CancelFlag = false; - var console3 = $('<div class="console3">'); - $('body').append(console3); - var controller3 = console3.console({ - promptLabel: 'Echo> ', - commandValidate:function(line){ - if (line == "") return false; - else return true; - }, - commandHandle:function(line,report){ - setTimeout(function() { - if(!console3CancelFlag) - report(line); - else { - report([{msg:"User interrupt", - className:"jquery-console-message-error"}]); - console3CancelFlag = false; - } - },1000); - }, - cancelHandle:function() { - console3CancelFlag = true; - }, - animateScroll:true, - promptHistory:true - }); - /* Fourth console */ - var console4 = $('<div class="console4">'); - $('body').append(console4); - var controller4 = console4.console({ - promptLabel: 'SQL> ', - continuedPromptLabel: ' -> ', - commandValidate:function(line){ - if (line == "") return false; - else return true; - }, - commandHandle:function(line,report){ - if (line.match(/;$/)) { - controller4.continuedPrompt = false; - alert("Execute: " + line); - return true; - } else { - controller4.continuedPrompt = true; - return; - } - }, - promptHistory:true - }); }); </script> <style type="text/css" media="screen"> /* First console */ div.console1 { font-size: 14px } div.console1 div.jquery-console-inner { width:900px; height:200px; background:#333; padding:0.5em; overflow:auto } div.console1 div.jquery-console-prompt-box { color:#fff; font-family:monospace; } div.console1 div.jquery-console-focus span.jquery-console-cursor { background:#fefefe; color:#333; font-weight:bold } div.console1 div.jquery-console-message-error { color:#ef0505; font-family:sans-serif; font-weight:bold; padding:0.1em; } div.console1 div.jquery-console-message-value { color:#1ad027; font-family:monospace; padding:0.1em; } div.console1 div.jquery-console-message-type { color:#52666f; font-family:monospace; padding:0.1em; } div.console1 span.jquery-console-prompt-label { font-weight:bold } - /* Second console */ - div.console2 { font-size: 14px; margin-top:1em } - div.console2 div.jquery-console-inner - { width:900px; height:200px; background:#efefef; padding:0.5em; - overflow:auto } - div.console2 div.jquery-console-prompt-box - { color:#444; font-family:monospace; } - div.console2 div.jquery-console-focus span.jquery-console-cursor - { background:#333; color:#eee; font-weight:bold } - div.console2 div.jquery-console-message-error - { color:#ef0505; font-family:sans-serif; font-weight:bold; - padding:0.1em; } - div.console2 div.jquery-console-message-success - { color:#187718; font-family:monospace; - padding:0.1em; } - div.console2 span.jquery-console-prompt-label { font-weight:bold } - /* Third console */ - div.console3 { font-size: 14px; margin-top:1em } - div.console3 div.jquery-console-inner - { width:900px; height:200px; background:#efefef; padding:0.5em; - overflow:auto } - div.console3 div.jquery-console-prompt-box - { color:#444; font-family:monospace; } - div.console3 div.jquery-console-focus span.jquery-console-cursor - { background:#333; color:#eee; font-weight:bold } - div.console3 div.jquery-console-message-error - { color:#ef0505; font-family:sans-serif; font-weight:bold; - padding:0.1em; } - div.console3 div.jquery-console-message-success - { color:#187718; font-family:monospace; - padding:0.1em; } - div.console3 span.jquery-console-prompt-label { - font-weight:bold } - /* Fourth console */ - div.console4 { font-size: 14px; margin-top:1em } - div.console4 div.jquery-console-inner - { width:900px; height:200px; background:#efefef; padding:0.5em; - overflow:auto } - div.console4 div.jquery-console-prompt-box - { color:#444; font-family:monospace; } - div.console4 div.jquery-console-focus span.jquery-console-cursor - { background:#444; color:#eee; font-weight:bold } - div.console4 div.jquery-console-message-error - { color:#ef0505; font-family:sans-serif; font-weight:bold; - padding:0.1em; } - div.console4 div.jquery-console-message-success - { color:#187718; font-family:monospace; - padding:0.1em; } - div.console4 span.jquery-console-prompt-label { font-weight:bold } </style> </head> <body> <noscript> <p> <strong>Please enable JavaScript or upgrade your browser.</strong> </p> </noscript> - <h1>Simple console demo</h1> - <p>Tested on:</p> - <ul> - <li>Internet Explorer 6</li> - <li>Opera 10.01</li> - <li>Chromium 4.0.237.0 (Ubuntu build 31094)</li> - <li>Firefox 3.5.8</li> - </ul> + <h1>Jive Script Console</h1> </body> </html> diff --git a/script-plugin/src/main/plugin/struts.xml b/script-plugin/src/main/plugin/struts.xml index 6123ef7..e561c6b 100644 --- a/script-plugin/src/main/plugin/struts.xml +++ b/script-plugin/src/main/plugin/struts.xml @@ -1,16 +1,16 @@ <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> - <package name="script-plugin-actions" extends="community-custom"> + <package name="script-plugin-actions" extends="community-admin-default" namespace="/admin" > <action name="script-console" class="com.syncapse.plugin.script.action.ScriptAction"> - <result name="success">/plugins/script-plugin/resources/templates/script-console.ftl</result> + <result name="success" type="freemarker">/plugins/script-plugin/resources/templates/script-console.ftl</result> <result name="json" type="stream"> <param name="contentType">application/json</param> <param name="inputName">scriptResult</param> <param name="bufferSize">1024</param> </result> </action> </package> </struts> diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala index 866698a..218ca36 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala @@ -1,49 +1,53 @@ package com.syncapse.plugin.script import com.syncapse.jive.Loggable import java.io.{Writer, StringWriter} -import javax.script.{ScriptContext, SimpleScriptContext, ScriptEngineManager} import java.lang.String - +import javax.script._ trait ScriptType { def name: String; } object ScriptType { - val ECMA_SCRIPT = "ECMAScript" - - case class ECMAScriptType extends ScriptType {def name = ECMA_SCRIPT} + case object ECMA_SCRIPT extends ScriptType { def name = "ECMAScript" } def getScriptType(name: String): ScriptType = name match { - case ECMA_SCRIPT => ECMAScriptType() + case "ECMAScript" => ECMA_SCRIPT.asInstanceOf[ScriptType] } } -case class ScriptResult(content: String) +case class ScriptResult(msg: String) case class ErrorResult(msg: String) object ScriptRunner extends Loggable { protected lazy val engineManager = new ScriptEngineManager(); def execute(scriptType: ScriptType, script: String): Either[ErrorResult, ScriptResult] = { val engine = engineManager.getEngineByName(scriptType.name) - if (engine != null) { - val writer = new StringWriter - val ctx = buildContext(writer) - engine.eval(script, ctx) - Right(ScriptResult(writer.toString)) - + if (engine != null) { + try { + val writer = new StringWriter + val ctx = buildContext(writer) + val result = engine.eval(script, ctx).toString + Right(ScriptResult(result)) + } + catch { + case e: ScriptException => + logger.warn(e.getMessage, e) + Left(ErrorResult(e.getMessage)) + } } else { logger.warn("Could not determine engine, not executing script") Left(ErrorResult("Could not determine engine, not executing script")) } } protected def buildContext(writer: Writer): ScriptContext = { val context = new SimpleScriptContext context.setWriter(writer) + context.setErrorWriter(writer) context } } \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala index f987bb9..5adb8bf 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -1,35 +1,37 @@ package com.syncapse.plugin.script.action import com.opensymphony.xwork2.{Action, ActionSupport} import reflect.BeanProperty import com.syncapse.plugin.script.{ScriptResult, ErrorResult, ScriptType, ScriptRunner} import java.io.{ByteArrayInputStream, InputStream} -import util.parsing.json.JSONObject +import com.twitter.json.Json +import com.jivesoftware.community.action.util.Decorate +@Decorate(false) class ScriptAction extends ActionSupport { @BeanProperty var script: String = null @BeanProperty - var scriptType: String = ScriptType.ECMA_SCRIPT + var scriptType: String = ScriptType.ECMA_SCRIPT.name @BeanProperty var scriptResult: InputStream = null override def execute = { Action.SUCCESS } def process: String = { val sType = ScriptType.getScriptType(scriptType) val json = asJSON(ScriptRunner.execute(sType, script)) scriptResult = new ByteArrayInputStream(json.toString.getBytes("UTF-8")) "json" } def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { - case Left(ErrorResult(msg)) => new JSONObject(Map("msg" -> msg)) - case Right(ScriptResult(msg)) => new JSONObject(Map("msg" -> msg)) + case Left(ErrorResult(msg)) => Json.build(Map("msg" -> msg)) + case Right(ScriptResult(msg)) => Json.build(Map("msg" -> msg)) } } \ No newline at end of file diff --git a/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala b/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala new file mode 100644 index 0000000..0f569a1 --- /dev/null +++ b/script-plugin/src/test/scala/com/syncapse/plugin/script/ScriptRunnerSpec.scala @@ -0,0 +1,18 @@ +package com.syncapse.plugin.script + +import org.specs.Specification +import org.specs.mock.Mockito +import org.specs.runner.JUnit4 + +class ScriptRunnerTest extends JUnit4(ScriptRunnerSpec) +object ScriptRunnerSpec extends Specification with Mockito { + "ScriptRunner" should { + "be 2 " in { + ScriptRunner.execute(ScriptType.ECMA_SCRIPT, "1 + 1;") match { + case Left(error) => fail("Should not have an error") + case Right(result) => result.msg must beEqual("2.0"); + } + } + } + +} \ No newline at end of file
ayax79/jive-dev
36bea4d67cb23cab19a079e69dad04dbf9893a3a
implementing action runner, etc.
diff --git a/script-plugin/pom.xml b/script-plugin/pom.xml index bf58883..b413fb4 100644 --- a/script-plugin/pom.xml +++ b/script-plugin/pom.xml @@ -1,165 +1,199 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ~ $Revision: 96475 $ ~ $Date: 2009-11-02 16:51:02 -0800 (Mon, 02 Nov 2009) $ ~ ~ Copyright (C) 1999-${YEAR} Jive Software. All rights reserved. ~ ~ This software is the proprietary information of Jive Software. Use is subject to license terms. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- These parameters were pased in via the commandline when this pom was created by the archetype. --> <modelVersion>4.0.0</modelVersion> <groupId>com.syncapse.jive</groupId> <artifactId>script-plugin-plugin</artifactId> <name>script-plugin</name> <version>1.0</version> <packaging>jar</packaging> <url>http://www.jivesoftware.com</url> <build> <finalName>script-plugin-plugin-${sbs.version}-${version}</finalName> <sourceDirectory>src/main/scala</sourceDirectory> <testSourceDirectory>src/test/scala</testSourceDirectory> <plugins> <!-- For compilation--> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- Weave transactions into the plugin --> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-5</version> <executions> <execution> <id>assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>${basedir}/src/main/assembly/assembly-plugin.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> + <plugin> + <groupId>org.scala-tools</groupId> + <artifactId>maven-scala-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>compile</goal> + <goal>testCompile</goal> + </goals> + </execution> + </executions> + <configuration> + <scalaVersion>${scala.version}</scalaVersion> + <args> + <arg>-target:jvm-1.5</arg> + </args> + </configuration> + </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <!-- Unpackages this SBS plugin. That way it can be used in conjunction with the -DpluginDirs= property, which bypasses the standard plugin installation (which happens via the admin console), by pointing to exploded plugin jar created by this. --> <id>explode-sbs-plugin</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <mkdir dir="${basedir}/target/script-plugin-${sbs.version}-${version}"/> <unjar src="${basedir}/target/script-plugin-plugin-${sbs.version}-${version}.jar" dest="${basedir}/target/script-plugin-${sbs.version}-${version}"/> </tasks> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <phase>verify</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- For unit testing --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <downloadSources>true</downloadSources> <buildcommands> <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand> </buildcommands> <additionalProjectnatures> <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature> </additionalProjectnatures> <classpathContainers> <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer> </classpathContainers> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-deps-for-jrebel</id> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <excludeScope>provided</excludeScope> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> <dependencies> <dependency> <groupId>com.syncapse</groupId> <artifactId>jive-scala</artifactId> <version>1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee</artifactId> <version>${sbs.version}</version> <type>jar</type> <scope>provided</scope> </dependency> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee-all</artifactId> <version>${sbs.version}</version> <type>pom</type> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.3</version> <type>jar</type> <scope>provided</scope> </dependency> <!-- The following dependencies are for unit testing--> <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> <scope>test</scope> </dependency> <dependency> <groupId>org.specs</groupId> <artifactId>specs</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> </dependencies> <!-- This is where you set the Jive SBS version your plugin is compiled against. --> <properties> <sbs.version>4.5.1</sbs.version> <scala.version>2.8.0</scala.version> </properties> </project> diff --git a/script-plugin/src/main/plugin/resources/templates/script-console.ftl b/script-plugin/src/main/plugin/resources/templates/script-console.ftl index f1bd696..302b6e9 100644 --- a/script-plugin/src/main/plugin/resources/templates/script-console.ftl +++ b/script-plugin/src/main/plugin/resources/templates/script-console.ftl @@ -1,193 +1,205 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>JQuery Console Demo</title> <meta name="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript" src="jquery.console.js"></script> <!-- Everything beyond this point is user-customized --> <script type="text/javascript"> $(document).ready(function(){ /* First console */ var console1 = $('<div class="console1">'); $('body').append(console1); var controller1 = console1.console({ promptLabel: 'Demo> ', commandValidate:function(line){ if (line == "") return false; else return true; }, commandHandle:function(line){ - return [{msg:"=> [12,42]", - className:"jquery-console-message-value"}, - {msg:":: [a]", - className:"jquery-console-message-type"}] +// return [{msg:"=> [12,42]", +// className:"jquery-console-message-value"}, +// {msg:":: [a]", +// className:"jquery-console-message-type"}] + + + try { + $.post('<@s.url action="script-console" method="process" />', + { script: line }, function(data) { + report([ + {msg: " => " + data.msg, className:"jquery-console-message-value"} + ]); + }, "json"); + } catch (e) { + return e.toString(); + } }, autofocus:true, animateScroll:true, promptHistory:true, charInsertTrigger:function(keycode,line){ // Let you type until you press a-z // Never allow zero. return !line.match(/[a-z]+/) && keycode != '0'.charCodeAt(0); } }); /* Second console */ var console2 = $('<div class="console2">'); $('body').append(console2); var controller2 = console2.console({ promptLabel: 'JavaScript> ', commandValidate:function(line){ if (line == "") return false; else return true; }, commandHandle:function(line){ try { var ret = eval(line); if (typeof ret != 'undefined') return ret.toString(); else return true; } catch (e) { return e.toString(); } }, animateScroll:true, promptHistory:true, - welcomeMessage:'Enter some JavaScript expressions to evaluate.' + welcomeMessage:'Enter some expressions to evaluate.' }); controller2.promptText('5 * 4'); /* Third console */ var console3CancelFlag = false; var console3 = $('<div class="console3">'); $('body').append(console3); var controller3 = console3.console({ promptLabel: 'Echo> ', commandValidate:function(line){ if (line == "") return false; else return true; }, commandHandle:function(line,report){ setTimeout(function() { if(!console3CancelFlag) report(line); else { report([{msg:"User interrupt", className:"jquery-console-message-error"}]); console3CancelFlag = false; } },1000); }, cancelHandle:function() { console3CancelFlag = true; }, animateScroll:true, promptHistory:true }); /* Fourth console */ var console4 = $('<div class="console4">'); $('body').append(console4); var controller4 = console4.console({ promptLabel: 'SQL> ', continuedPromptLabel: ' -> ', commandValidate:function(line){ if (line == "") return false; else return true; }, commandHandle:function(line,report){ if (line.match(/;$/)) { controller4.continuedPrompt = false; alert("Execute: " + line); return true; } else { controller4.continuedPrompt = true; return; } }, promptHistory:true }); }); </script> <style type="text/css" media="screen"> /* First console */ div.console1 { font-size: 14px } div.console1 div.jquery-console-inner { width:900px; height:200px; background:#333; padding:0.5em; overflow:auto } div.console1 div.jquery-console-prompt-box { color:#fff; font-family:monospace; } div.console1 div.jquery-console-focus span.jquery-console-cursor { background:#fefefe; color:#333; font-weight:bold } div.console1 div.jquery-console-message-error { color:#ef0505; font-family:sans-serif; font-weight:bold; padding:0.1em; } div.console1 div.jquery-console-message-value { color:#1ad027; font-family:monospace; padding:0.1em; } div.console1 div.jquery-console-message-type { color:#52666f; font-family:monospace; padding:0.1em; } div.console1 span.jquery-console-prompt-label { font-weight:bold } /* Second console */ div.console2 { font-size: 14px; margin-top:1em } div.console2 div.jquery-console-inner { width:900px; height:200px; background:#efefef; padding:0.5em; overflow:auto } div.console2 div.jquery-console-prompt-box { color:#444; font-family:monospace; } div.console2 div.jquery-console-focus span.jquery-console-cursor { background:#333; color:#eee; font-weight:bold } div.console2 div.jquery-console-message-error { color:#ef0505; font-family:sans-serif; font-weight:bold; padding:0.1em; } div.console2 div.jquery-console-message-success { color:#187718; font-family:monospace; padding:0.1em; } div.console2 span.jquery-console-prompt-label { font-weight:bold } /* Third console */ div.console3 { font-size: 14px; margin-top:1em } div.console3 div.jquery-console-inner { width:900px; height:200px; background:#efefef; padding:0.5em; overflow:auto } div.console3 div.jquery-console-prompt-box { color:#444; font-family:monospace; } div.console3 div.jquery-console-focus span.jquery-console-cursor { background:#333; color:#eee; font-weight:bold } div.console3 div.jquery-console-message-error { color:#ef0505; font-family:sans-serif; font-weight:bold; padding:0.1em; } div.console3 div.jquery-console-message-success { color:#187718; font-family:monospace; padding:0.1em; } div.console3 span.jquery-console-prompt-label { font-weight:bold } /* Fourth console */ div.console4 { font-size: 14px; margin-top:1em } div.console4 div.jquery-console-inner { width:900px; height:200px; background:#efefef; padding:0.5em; overflow:auto } div.console4 div.jquery-console-prompt-box { color:#444; font-family:monospace; } div.console4 div.jquery-console-focus span.jquery-console-cursor { background:#444; color:#eee; font-weight:bold } div.console4 div.jquery-console-message-error { color:#ef0505; font-family:sans-serif; font-weight:bold; padding:0.1em; } div.console4 div.jquery-console-message-success { color:#187718; font-family:monospace; padding:0.1em; } div.console4 span.jquery-console-prompt-label { font-weight:bold } </style> </head> <body> <noscript> <p> <strong>Please enable JavaScript or upgrade your browser.</strong> </p> </noscript> <h1>Simple console demo</h1> <p>Tested on:</p> <ul> <li>Internet Explorer 6</li> <li>Opera 10.01</li> <li>Chromium 4.0.237.0 (Ubuntu build 31094)</li> <li>Firefox 3.5.8</li> </ul> </body> </html> diff --git a/script-plugin/src/main/plugin/spring.xml b/script-plugin/src/main/plugin/spring.xml index 21d0a68..0332dcc 100644 --- a/script-plugin/src/main/plugin/spring.xml +++ b/script-plugin/src/main/plugin/spring.xml @@ -1,14 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" default-autowire="no" default-init-method="init" default-destroy-method="destroy"> - <bean id="module1" class="SamplePlugin"> - </bean> - </beans> diff --git a/script-plugin/src/main/plugin/struts.xml b/script-plugin/src/main/plugin/struts.xml index 835bd9b..6123ef7 100644 --- a/script-plugin/src/main/plugin/struts.xml +++ b/script-plugin/src/main/plugin/struts.xml @@ -1,10 +1,16 @@ -<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> +<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" + "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="script-plugin-actions" extends="community-custom"> <action name="script-console" class="com.syncapse.plugin.script.action.ScriptAction"> <result name="success">/plugins/script-plugin/resources/templates/script-console.ftl</result> + <result name="json" type="stream"> + <param name="contentType">application/json</param> + <param name="inputName">scriptResult</param> + <param name="bufferSize">1024</param> + </result> </action> </package> </struts> diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala index d658437..866698a 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala @@ -1,44 +1,49 @@ package com.syncapse.plugin.script import com.syncapse.jive.Loggable -import javax.script.{SimpleScriptContext, ScriptEngineManager} import java.io.{Writer, StringWriter} +import javax.script.{ScriptContext, SimpleScriptContext, ScriptEngineManager} +import java.lang.String trait ScriptType { - abstract def name: String; + def name: String; } object ScriptType { - case class ECMAScriptType extends ScriptType {def name = "ECMAScript"} + val ECMA_SCRIPT = "ECMAScript" + + case class ECMAScriptType extends ScriptType {def name = ECMA_SCRIPT} def getScriptType(name: String): ScriptType = name match { - case ECMAScriptType.name => ECMAScriptType + case ECMA_SCRIPT => ECMAScriptType() } - - } - +case class ScriptResult(content: String) +case class ErrorResult(msg: String) object ScriptRunner extends Loggable { protected lazy val engineManager = new ScriptEngineManager(); - def execute(scriptType: ScriptType, script: String): String = { - val engine = engineManager.getEngineByName(scriptType) + def execute(scriptType: ScriptType, script: String): Either[ErrorResult, ScriptResult] = { + val engine = engineManager.getEngineByName(scriptType.name) if (engine != null) { val writer = new StringWriter - val ctx = buildContext(ctx) + val ctx = buildContext(writer) engine.eval(script, ctx) - writer.toString - } else logger.warn("Could not determine engine, not executing script") - } + Right(ScriptResult(writer.toString)) + } else { + logger.warn("Could not determine engine, not executing script") + Left(ErrorResult("Could not determine engine, not executing script")) + } + } - protected def buildContext(writer: Writer) = { + protected def buildContext(writer: Writer): ScriptContext = { val context = new SimpleScriptContext context.setWriter(writer) context } } \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala index b6458f0..f987bb9 100644 --- a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -1,11 +1,35 @@ package com.syncapse.plugin.script.action import com.opensymphony.xwork2.{Action, ActionSupport} +import reflect.BeanProperty +import com.syncapse.plugin.script.{ScriptResult, ErrorResult, ScriptType, ScriptRunner} +import java.io.{ByteArrayInputStream, InputStream} +import util.parsing.json.JSONObject class ScriptAction extends ActionSupport { - + @BeanProperty + var script: String = null + + @BeanProperty + var scriptType: String = ScriptType.ECMA_SCRIPT + + @BeanProperty + var scriptResult: InputStream = null + override def execute = { Action.SUCCESS } + def process: String = { + val sType = ScriptType.getScriptType(scriptType) + val json = asJSON(ScriptRunner.execute(sType, script)) + scriptResult = new ByteArrayInputStream(json.toString.getBytes("UTF-8")) + "json" + } + + def asJSON(scriptResult: Either[ErrorResult, ScriptResult]) = scriptResult match { + case Left(ErrorResult(msg)) => new JSONObject(Map("msg" -> msg)) + case Right(ScriptResult(msg)) => new JSONObject(Map("msg" -> msg)) + } + } \ No newline at end of file diff --git a/script-plugin/src/test/scala/SamplePluginSpec.scala b/script-plugin/src/test/scala/SamplePluginSpec.scala deleted file mode 100644 index d447ea2..0000000 --- a/script-plugin/src/test/scala/SamplePluginSpec.scala +++ /dev/null @@ -1,16 +0,0 @@ -import org.specs._ -import org.specs.runner.{ConsoleRunner, JUnit4} - -class SamplePluginTest extends JUnit4(SamplePluginSpec) - -object SamplePluginRunner extends ConsoleRunner(SamplePluginSpec) - -object SamplePlugin extends Specification { - "This wonderful system" should { - "save the world" in { - val list = Nil - list must beEmpty - } - } - -}
ayax79/jive-dev
eb9221c511de4780585473728353d5566873d847
removed plugin class name.
diff --git a/script-plugin/src/main/plugin/plugin.xml b/script-plugin/src/main/plugin/plugin.xml index d8dc3f4..d49e6ac 100644 --- a/script-plugin/src/main/plugin/plugin.xml +++ b/script-plugin/src/main/plugin/plugin.xml @@ -1,23 +1,21 @@ <plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.jivesoftware.com/schemas/clearspace/2_5/plugin.xsd"> <name>script-plugin</name> <description>script-plugin</description> <author></author> <version>1.0.0</version> <minServerVersion>4.5.0</minServerVersion> - <!-- you will want to change your class name here! --> - <class>SamplePlugin</class> <!-- The <components> element contains additions or customizations to components in the user interface. Each <component> child element represents a different UI piece, with its id attribute value specifying which piece is being customized. Here, you're customizing the user bar (the menu bar at the top of each Clearspace page) so that its Browse menu gets a new entry item, "Say Hello". The <url> element here specifies the URL that Clearspace will load when the user clicks the item. In this case, Clearspace will execute the sayhello action (which is defined in the xwork-plugin.xml file). --> </plugin> diff --git a/web/pom.xml b/web/pom.xml index f580c65..a2fb9d6 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -1,519 +1,519 @@ <!-- The web pom is where we build a new custom war (overlay and custom files are copied into your WEB-INF/classes of the war) and run and test things via Cargo. Running package here will not trigger a re-build of any plugins referenced in your parent pom. However, the pluginDirs mojo will detect any sibling plugins and supply them to Cargo, so that all your project's plugins will be run. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <name>weboverlay</name> <modelVersion>4.0.0</modelVersion> <groupId>com.syncapse.jive</groupId> <artifactId>web</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <description> Custom Jive SBS war. We try to only place files in this project that MUST be overlayed. Usually this means there is no way to make the change as a plugin. Most customizations can be done by plugin these days, and there are many advantages to doing so in terms of packaging, deployment, upgradability and debugging. Overlaying a file ensures that you will have to put forth at least some development effort when you want to upgrade versions of Jive SBS. </description> <parent> <groupId>com.syncapse.jive</groupId> <artifactId>jive-dev</artifactId> <version>1.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <build> <finalName> ${customer.name}-${customer.version}-sbs-${sbs.version} </finalName> <resources> <resource> <directory>${basedir}/src/main/resources-filtered</directory> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <!-- compiling with JDK 6 now --> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <!-- If you are making use of the Cobertura reports, they generate a .ser file that must be deleted, or your coverage data will be corrupted on successive runs --> <execution> <id>delete-cobertura-ser</id> <phase>clean</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <echo message="deleting cobertura.ser" /> <delete file="${basedir}/cobertura.ser" failonerror="false"/> </tasks> </configuration> </execution> <execution> <id>compile-sbs-artifacts</id> <phase>compile</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <!-- Copy themes files into ../target/jiveHome/themes for testing --> <copy todir="${basedir}/../target/jiveHome/themes" overwrite="true"> <fileset dir="${basedir}/src/main/themes"> <include name="**/*" /> </fileset> </copy> <!-- Now build a new themes.zip for distribution --> <mkdir dir="${project.build.directory}/themes"/> <copy todir="${project.build.directory}/themes" overwrite="yes" filtering="off"> <fileset dir="${basedir}/src/main/themes" includes="**/*" excludes="**/.svn, **/.svn/**" /> </copy> <zip destfile="${project.build.directory}/themes.zip"> <zipfileset dir="${project.build.directory}/themes" prefix=""/> </zip> <!-- Copy your etc directory to ../target/jiveHome for testing--> <mkdir dir="../target/jiveHome/etc"/> <copy todir="../target/jiveHome/etc" overwrite="true"> <fileset dir="src/main/etc"> <include name="*.xml"/> </fileset> </copy> <!-- Build an etc.zip for distribution--> <zip destfile="${project.build.directory}/etc.zip"> <zipfileset dir="${basedir}/src/main/etc" prefix=""/> </zip> <!-- Copy your etc directory to ../target/jiveHome for testing--> <mkdir dir="../target/jiveHome/keys"/> <copy todir="../target/jiveHome/keys" overwrite="true"> <fileset dir="${basedir}/src/main/keys"> <include name="*.der"/> </fileset> </copy> <!-- Build an keys.zip for distribution--> <zip destfile="${project.build.directory}/keys.zip"> <zipfileset dir="${basedir}/src/main/keys" prefix=""/> </zip> </tasks> </configuration> </execution> <!-- The execution below should be used when a project needs to overlay any Jive SBS bean.properties or resources in the Jive SBS directory "resources.scripts". In order for these overlay files to actually override their equivalents in the Jive SBS jar, they need to be placed in the Jive SBS jar itself. --> <!--<execution>--> <!--<id>repackage-sbs-jar</id>--> <!--<phase>package</phase>--> <!--<goals>--> <!--<goal>run</goal>--> <!--</goals>--> <!--<configuration>--> <!--<tasks>--> <!--Overlay items in the overlay directory into the jar distributed in the war --> <!--<unjar src="./target/${build.finalName}/WEB-INF/lib/jive-sbs-employee-${sbs.shortversion}.jar"--> <!--dest="./target/jive-sbs-employee-temp-${sbs.shortversion}" />--> <!--<copy todir="./target/jive-sbs-employee-temp-${sbs.shortversion}" overwrite="true">--> <!--<fileset dir="./src/main/overlay/" includes="**/*"/>--> <!--</copy>--> <!--<taskdef name="yui-compressor"--> <!--classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask"--> <!--classpathref="maven.dependency.classpath"/>--> <!--<yui-compressor--> <!--warn="false"--> <!--munge="true"--> <!--preserveallsemicolons="false"--> <!--todir="./target/jive-sbs-employee-temp-${sbs.shortversion}"--> <!--fromdir="./src/main/overlay"--> <!--charset="utf8">--> <!--</yui-compressor>--> <!--<jar jarfile="./target/${build.finalName}/WEB-INF/lib/jive-sbs-employee-${sbs.shortversion}.jar" update="false">--> <!--<fileset dir="./target/jive-sbs-employee-temp-${sbs.shortversion}" includes="**/*"/>--> <!--</jar>--> <!--<jar destfile="./target/${build.finalName}.war">--> <!--<fileset dir="./target/${build.finalName}"/>--> <!--</jar>--> <!--</tasks>--> <!--</configuration>--> <!--</execution>--> </executions> </plugin> <plugin> <!-- Surefire is our unit testing framework of choice--> <artifactId>maven-surefire-plugin</artifactId> <configuration> <!-- Don't suck up selenium tests in there--> <excludes> <exclude>**/selenium/*Test.java</exclude> </excludes> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0</version> <configuration> <workingDirectory>${basedir}/target/tmp</workingDirectory> </configuration> </plugin> </plugins> </build> <!-- These properties are set by a TeamCity CI server. They get populated into the customer_version.jsp that is copied into our war file at the root. This gives you web-accessible, definitive build information --> <properties> <build.number>${env.BUILD_NUMBER}</build.number> <build.vcs.number>${env.BUILD_VCS_NUMBER.1}</build.vcs.number> <build.project.name>${env.TEAMCITY_PROJECT_NAME}</build.project.name> </properties> <dependencies> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee</artifactId> <!-- was clearspacex --> <version>${sbs.version}</version> <type>war</type> </dependency> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee</artifactId> <!-- was clearspacex --> <version>${sbs.version}</version> <type>jar</type> <scope>provided</scope> </dependency> <dependency> <groupId>com.jivesoftware</groupId> <artifactId>jive-sbs-employee-all</artifactId> <!-- was clearspacex-all --> <version>${sbs.version}</version> <type>pom</type> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>compile</scope> </dependency> <!-- We assume your jdbc jars will be provided at runtime--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.3-603.jdbc3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.openqa.selenium.client-drivers</groupId> <artifactId>selenium-java-client-driver</artifactId> <version>0.9.2</version> <scope>test</scope> </dependency> <!-- The dependencies below should be used when a project needs to overlay any resources in the Jive SBS directory "resources.scripts". In order for the minimized Javascript files to be generated, these dependencies must be present so the yui-compressor task can run --> <!--<dependency>--> <!--<groupId>com.jivesoftware</groupId>--> <!--<artifactId>yuicompressor</artifactId>--> <!--<version>2.2.4_2_0_0_rc1</version>--> <!--</dependency>--> <!--<dependency>--> <!--<groupId>com.jivesoftware</groupId>--> <!--<artifactId>yuicompressor-anttask</artifactId>--> <!--<version>2.4.2</version>--> <!--</dependency>--> </dependencies> <profiles> <profile> <id>int</id> <build> <plugins> <!-- Cargo is our main method of running and testing/debugging SBS. This is the main configuration area. --> <!-- Here is the config reference: http://cargo.codehaus.org/Maven2+Plugin+Reference+Guide --> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.0</version> <configuration> <!-- Feed them this value; Decides if Cargo should wait after the container is started or not --> <wait>${cargo.wait}</wait> <container> <containerId>tomcat6x</containerId> <home>${tomcat6.home}</home> <systemProperties> <jive.instance.home>${basedir}/../target/jiveHome</jive.instance.home> <jive.ws.disabled>true</jive.ws.disabled> <jive.devMode>true</jive.devMode> <themes.directory>${basedir}/src/main/themes</themes.directory> <!-- <pluginDirs>${basedir}/../myplugin/target/myplugin</pluginDirs> --> </systemProperties> <dependencies> <!-- Throw in our most common jdbc connectors; add yours here if it's missing --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <type>jar</type> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> </dependencies> </container> <configuration> <home>target/tomcat6x</home> <properties> <cargo.jvmargs>-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC</cargo.jvmargs> </properties> <deployables> <deployable> <location>target/${customer.name}-${customer.version}-sbs-${sbs.version}.war</location> <pingURL>http://localhost:8080/jive</pingURL> <properties> <context>jive</context> </properties> </deployable> </deployables> </configuration> </configuration> <executions> <execution> <id>start-container</id> <phase>pre-integration-test</phase> <goals> <goal>start</goal> </goals> </execution> <execution> <id>stop-container</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions> </plugin> <!-- Selenium Server Plugin http://mojo.codehaus.org/selenium-maven-plugin/usage.html--> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>selenium-maven-plugin</artifactId> <version>1.0-beta-3-SNAPSHOT</version> <executions> <execution> <id>start</id> <phase>pre-integration-test</phase> <goals> <goal>start-server</goal> </goals> <configuration> <background>true</background> </configuration> </execution> <execution> <id>stop</id> <phase>post-integration-test</phase> <goals> <goal>stop-server</goal> </goals> </execution> </executions> </plugin> <!-- Surefire plugin for unit testing: http://maven.apache.org/plugins/maven-surefire-plugin/usage.html--> <plugin> <artifactId>maven-surefire-plugin</artifactId> <executions> <execution> <id>surefire-it</id> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> <configuration> <excludes> <exclude>none</exclude> </excludes> <includes> <include>**/selenium/*Test.java</include> </includes> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <!-- This profile creates a cargo configuration that runs Tomcat with the exploded war. Running with the exploded war reduces the time that it takes for cargo to startup Tomcat. --> <profile> <id>dev</id> <build> <plugins> <!-- sets the pluginDirs property, which is used by Jive SBS to run plugins in dev mode --> <plugin> <groupId>com.jivesoftware.maven</groupId> <artifactId>pluginDirsMojo</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <id>start-container</id> <phase>pre-integration-test</phase> <goals> <goal>plugindirs</goal> </goals> </execution> </executions> </plugin> <!-- Cargo is our main method of running and testing/debugging SBS. This is the main configuration area. --> <!-- Here is the config reference: http://cargo.codehaus.org/Maven2+Plugin+Reference+Guide --> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.0</version> <configuration> <!-- In the dev profile, cargo will always wait --> <wait>true</wait> <container> <containerId>tomcat6x</containerId> <home>${tomcat6.home}</home> <systemProperties> <jive.instance.home>${basedir}/../target/jiveHome</jive.instance.home> <jive.ws.disabled>true</jive.ws.disabled> <jive.devMode>true</jive.devMode> <themes.directory>${basedir}/src/main/themes</themes.directory> <docverse.enabled>false</docverse.enabled> <rebel.struts2-plugin>true</rebel.struts2-plugin> - <!-- <pluginDirs>${basedir}/../myplugin/target/myplugin</pluginDirs> --> + <pluginDirs>${basedir}/../script-plugin/target/script-plugin-4.5.1-1.0</pluginDirs> </systemProperties> <dependencies> <!-- Throw in our most common jdbc connectors; add yours here if it's missing --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <type>jar</type> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> </dependencies> </container> <configuration> <home>target/tomcat6x</home> <properties> <cargo.jvmargs>-noverify -javaagent:${rebel.path} -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Xms1024m -Xmx2048m -XX:MaxPermSize=512m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC</cargo.jvmargs> <cargo.logging>low</cargo.logging> </properties> <deployables> <deployable> <location>target/${customer.name}-${customer.version}-sbs-${sbs.version}</location> <pingURL>http://localhost:8080/jive</pingURL> <properties> <context>jive</context> </properties> </deployable> </deployables> </configuration> </configuration> </plugin> - <!-- <plugin> + <plugin> <groupId>org.zeroturnaround</groupId> <artifactId>javarebel-maven-plugin</artifactId> <executions> <execution> <id>generate-rebel-xml</id> <phase>process-resources</phase> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <classpath> <fallback>default</fallback> <resources> <resource> - <directory>${basedir}/../myplugin/target/classes</directory> + <directory>${basedir}/../script-plugin/target/classes</directory> </resource> <resource> - <jarset>${basedir}/../myplugin/target/dependency</jarset> + <jarset>${basedir}/../script-plugin/target/dependency</jarset> </resource> </resources> </classpath> <war> <path>${basedir}/target/${customer.name}-${customer.version}-sbs-${sbs.version}</path> </war> </configuration> - </plugin> --> + </plugin> </plugins> </build> </profile> </profiles> <!-- Generate reports with mvn site --> <reporting> <outputDirectory>target/site</outputDirectory> <plugins> <plugin> <artifactId>maven-jxr-plugin</artifactId> </plugin> <plugin> <artifactId>maven-javadoc-plugin</artifactId> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>surefire-report-maven-plugin</artifactId> </plugin> <plugin> <artifactId>maven-pmd-plugin</artifactId> <configuration> <targetJdk>1.6</targetJdk> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.0</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>taglist-maven-plugin</artifactId> <version>2.0-beta-1</version> <configuration> <tags>TODO,@todo,FIXME,HACK,XXX,@deprecated</tags> </configuration> </plugin> </plugins> </reporting> </project>
ayax79/jive-dev
5d525ff728bf5797a8db1e6e5960ab530ced77a9
renamed.
diff --git a/script-plugin/src/main/plugin/struts.xml b/script-plugin/src/main/plugin/struts.xml index 7ce9245..835bd9b 100644 --- a/script-plugin/src/main/plugin/struts.xml +++ b/script-plugin/src/main/plugin/struts.xml @@ -1,5 +1,10 @@ <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="script-plugin-actions" extends="community-custom"> + + <action name="script-console" class="com.syncapse.plugin.script.action.ScriptAction"> + <result name="success">/plugins/script-plugin/resources/templates/script-console.ftl</result> + </action> + </package> </struts> diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala new file mode 100644 index 0000000..d658437 --- /dev/null +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/ScriptRunner.scala @@ -0,0 +1,44 @@ +package com.syncapse.plugin.script + +import com.syncapse.jive.Loggable +import javax.script.{SimpleScriptContext, ScriptEngineManager} +import java.io.{Writer, StringWriter} + + +trait ScriptType { + abstract def name: String; +} + +object ScriptType { + case class ECMAScriptType extends ScriptType {def name = "ECMAScript"} + + def getScriptType(name: String): ScriptType = name match { + case ECMAScriptType.name => ECMAScriptType + } + + +} + + + +object ScriptRunner extends Loggable { + protected lazy val engineManager = new ScriptEngineManager(); + + def execute(scriptType: ScriptType, script: String): String = { + val engine = engineManager.getEngineByName(scriptType) + if (engine != null) { + val writer = new StringWriter + val ctx = buildContext(ctx) + engine.eval(script, ctx) + writer.toString + } else logger.warn("Could not determine engine, not executing script") + } + + + protected def buildContext(writer: Writer) = { + val context = new SimpleScriptContext + context.setWriter(writer) + context + } + +} \ No newline at end of file diff --git a/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala new file mode 100644 index 0000000..b6458f0 --- /dev/null +++ b/script-plugin/src/main/scala/com/syncapse/plugin/script/action/ScriptAction.scala @@ -0,0 +1,11 @@ +package com.syncapse.plugin.script.action + +import com.opensymphony.xwork2.{Action, ActionSupport} + +class ScriptAction extends ActionSupport { + + override def execute = { + Action.SUCCESS + } + +} \ No newline at end of file
ayax79/jive-dev
f69f04558e208e649b1527f2bb6c5e800e932b22
config stuff.
diff --git a/script-plugin/pom.xml b/script-plugin/pom.xml index ea5e1e1..bf58883 100644 --- a/script-plugin/pom.xml +++ b/script-plugin/pom.xml @@ -1,157 +1,165 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ~ $Revision: 96475 $ ~ $Date: 2009-11-02 16:51:02 -0800 (Mon, 02 Nov 2009) $ ~ ~ Copyright (C) 1999-${YEAR} Jive Software. All rights reserved. ~ ~ This software is the proprietary information of Jive Software. Use is subject to license terms. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- These parameters were pased in via the commandline when this pom was created by the archetype. --> <modelVersion>4.0.0</modelVersion> <groupId>com.syncapse.jive</groupId> <artifactId>script-plugin-plugin</artifactId> <name>script-plugin</name> <version>1.0</version> <packaging>jar</packaging> <url>http://www.jivesoftware.com</url> <build> <finalName>script-plugin-plugin-${sbs.version}-${version}</finalName> - <sourceDirectory>src/main/scala</sourceDirectory> + <sourceDirectory>src/main/scala</sourceDirectory> <testSourceDirectory>src/test/scala</testSourceDirectory> <plugins> - <!-- For compilation--> + <!-- For compilation--> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- Weave transactions into the plugin --> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2-beta-5</version> <executions> <execution> <id>assembly</id> <phase>package</phase> - <goals><goal>single</goal></goals> + <goals> + <goal>single</goal> + </goals> <configuration> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>${basedir}/src/main/assembly/assembly-plugin.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <!-- Unpackages this SBS plugin. That way it can be used in conjunction with the -DpluginDirs= property, which bypasses the standard plugin installation (which happens via the admin console), by pointing to exploded plugin jar created by this. --> <id>explode-sbs-plugin</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> - <mkdir dir="${basedir}/target/script-plugin-${sbs.version}-${version}" /> - <unjar src="${basedir}/target/script-plugin-plugin-${sbs.version}-${version}.jar" dest="${basedir}/target/script-plugin-${sbs.version}-${version}" /> + <mkdir dir="${basedir}/target/script-plugin-${sbs.version}-${version}"/> + <unjar src="${basedir}/target/script-plugin-plugin-${sbs.version}-${version}.jar" + dest="${basedir}/target/script-plugin-${sbs.version}-${version}"/> </tasks> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <phase>verify</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> - <!-- For unit testing --> - <plugin> + <!-- For unit testing --> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <downloadSources>true</downloadSources> <buildcommands> <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand> </buildcommands> <additionalProjectnatures> <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature> </additionalProjectnatures> <classpathContainers> <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer> </classpathContainers> </configuration> </plugin> </plugins> </build> <dependencies> - <dependency> - <groupId>com.jivesoftware</groupId> - <artifactId>jive-sbs-employee</artifactId> - <version>${sbs.version}</version> - <type>jar</type> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>com.syncapse</groupId> + <artifactId>jive-scala</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee</artifactId> + <version>${sbs.version}</version> + <type>jar</type> + <scope>provided</scope> + </dependency> - <dependency> - <groupId>com.jivesoftware</groupId> - <artifactId>jive-sbs-employee-all</artifactId> - <version>${sbs.version}</version> - <type>pom</type> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee-all</artifactId> + <version>${sbs.version}</version> + <type>pom</type> + <scope>provided</scope> + </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.3</version> <type>jar</type> <scope>provided</scope> </dependency> - <!-- The following dependencies are for unit testing--> - <dependency> + <!-- The following dependencies are for unit testing--> + <dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.4</version> <scope>test</scope> </dependency> <dependency> <groupId>org.specs</groupId> <artifactId>specs</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> </dependencies> <!-- This is where you set the Jive SBS version your plugin is compiled against. --> <properties> <sbs.version>4.5.1</sbs.version> - <scala.version>2.8.0</scala.version> + <scala.version>2.8.0</scala.version> </properties> </project>
ayax79/jive-dev
a1c83e86ca07dfca5d515a4e5e44f0eda0743d2a
configuration
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1965d64 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +web/target +script-plugin/target +*.iml +*.ipr +*.iws +web/overlays diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7121811 --- /dev/null +++ b/pom.xml @@ -0,0 +1,214 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + This is the root pom file for a Jive SBS customization project. + + Each plugin in your project will be represented here as a module. By default you get + a "web" module. Although you can build all modules from the root of your customization project + most of the activity will take place in the sub-modules. For example, you currently run + your web app via Cargo from within your web/ module. + + To change the Jive SBS version this customization project is attached to modify the clearspace.version + property at the bottom of the file. +--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>com.syncapse.jive</groupId> + <artifactId>jive-dev</artifactId> + <version>1.0-SNAPSHOT</version> + <description>Jive SBS implementation project. This is the parent pom</description> + <packaging>pom</packaging> + + <modules> + <module>web</module> + <module>script-plugin</module> + </modules> + + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.3</version> + <inherited>false</inherited> + <executions> + <!-- + We're currently using Ant to build a jiveHome suitable for testing in the root project target directory: ./target/jiveHome + You can rely on this to run your unit tests, or to test via Cargo. When your webapp starts, point to this + in the Admin Console. + + The jive.setup property (settable at the bottom of this pom.xml) gets filtered into the jive_startup.xml. Use that + to toggle whether you go into the startup configuration screens or not. You can override this by setting it to false here + or via the commandline, e.g. if you want to change any system configurations, databses, jiveHome, etc. + --> + <execution> + <id>package-clearspace-plugin</id> + <phase>process-test-resources</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <echo message="building jive home"/> + <mkdir dir="${project.build.directory}"/> + <mkdir dir="${project.build.directory}/jiveHome"/> + <mkdir dir="${project.build.directory}/jiveHome/plugins"/> + <mkdir dir="${project.build.directory}/jiveHome/themes"/> + <filter token="jive.setup" value="${jive.setup}"/> + <copy todir="./target/jiveHome" overwrite="true" filtering="true"> + <filterset> + <filter token="jive.setup" value="${jive.setup}"/> + </filterset> + <fileset dir="src/test/resources/jiveHome"> + <include name="**/*.*"/> + </fileset> + </copy> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + <!-- + The upgrade plugin generates diffs between custom overlayed files and the newest version, to ease upgrades. + + We are hard at work upgrading this plugin to work for the general public. Please be patient until it's done. + --> + <plugin> + <groupId>com.jivesoftware.maven</groupId> + <artifactId>maven-upgrade-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <inherited>false</inherited> + <configuration> + <currentVersion>${sbs.version}</currentVersion> + <upgradeVersion>${upgrade.version}</upgradeVersion> + <svnUser>${svn.username}</svnUser> + <svnPassword>${svn.password}</svnPassword> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <verbose>true</verbose> + <fork>true</fork> + <executable><!-- path-to-javac --></executable> + <compilerVersion>1.6</compilerVersion> <!-- compiling with JDK 6 now --> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <!-- Unit testing dependencies. You unit test all your code, right? --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.objenesis</groupId> + <artifactId>objenesis</artifactId> + <version>1.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib</artifactId> + <version>2.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jmock</groupId> + <artifactId>jmock-junit4</artifactId> + <version>2.4.0</version> + <scope>test</scope> + </dependency> + </dependencies> + + + <!-- + Modify these properties to conform to your own environment + --> + <properties> + <customer.name>jive-dev</customer.name> + <customer.version>1.0-SNAPSHOT</customer.version> + <sbs.shortversion>4.5.3</sbs.shortversion> + <sbs.version>4.5.3</sbs.version> + <!-- This gets filtered into the setup param in your jive_init.xml Set to false if you want to enter setup screens--> + <jive.setup>true</jive.setup> + <cargo.wait>false</cargo.wait> + <java.compiler>${java.home}/bin/javac</java.compiler> + </properties> + + <organization> + <name>Jive Software</name> + <url>http://jivesoftware.com</url> + </organization> + + <!-- + For some nice reports run mvn site:site + --> + <reporting> + <outputDirectory>target/site</outputDirectory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <reportSets> + <reportSet> + <reports> + <report>index</report> + <report>plugins</report> + <report>license</report> + <report>project-team</report> + <report>summary</report> + <report>cim</report> + <report>issue-tracking</report> + <report>scm</report> + <report>plugin-management</report> + <report>mailing-list</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>surefire-report-maven-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.6</targetJdk> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.0-beta-1</version> + <configuration> + <tags>TODO,@todo,FIXME,HACK,XXX,@deprecated</tags> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>jdepend-maven-plugin</artifactId> + </plugin> + </plugins> + </reporting> +</project> \ No newline at end of file diff --git a/script-plugin/pom.xml b/script-plugin/pom.xml new file mode 100644 index 0000000..ea5e1e1 --- /dev/null +++ b/script-plugin/pom.xml @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ $Revision: 96475 $ + ~ $Date: 2009-11-02 16:51:02 -0800 (Mon, 02 Nov 2009) $ + ~ + ~ Copyright (C) 1999-${YEAR} Jive Software. All rights reserved. + ~ + ~ This software is the proprietary information of Jive Software. Use is subject to license terms. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <!-- + These parameters were pased in via the commandline when this pom was created by the archetype. + --> + <modelVersion>4.0.0</modelVersion> + <groupId>com.syncapse.jive</groupId> + <artifactId>script-plugin-plugin</artifactId> + <name>script-plugin</name> + <version>1.0</version> + <packaging>jar</packaging> + <url>http://www.jivesoftware.com</url> + + <build> + <finalName>script-plugin-plugin-${sbs.version}-${version}</finalName> + <sourceDirectory>src/main/scala</sourceDirectory> + <testSourceDirectory>src/test/scala</testSourceDirectory> + <plugins> + <!-- For compilation--> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <!-- Weave transactions into the plugin --> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-5</version> + <executions> + <execution> + <id>assembly</id> + <phase>package</phase> + <goals><goal>single</goal></goals> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <descriptors> + <descriptor>${basedir}/src/main/assembly/assembly-plugin.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <!-- Unpackages this SBS plugin. That way it can be used in conjunction with the -DpluginDirs= property, which + bypasses the standard plugin installation (which happens via the admin console), by pointing to exploded plugin jar created by this. --> + <id>explode-sbs-plugin</id> + <phase>package</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <mkdir dir="${basedir}/target/script-plugin-${sbs.version}-${version}" /> + <unjar src="${basedir}/target/script-plugin-plugin-${sbs.version}-${version}.jar" dest="${basedir}/target/script-plugin-${sbs.version}-${version}" /> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + <phase>verify</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- For unit testing --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-eclipse-plugin</artifactId> + <configuration> + <downloadSources>true</downloadSources> + <buildcommands> + <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand> + </buildcommands> + <additionalProjectnatures> + <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature> + </additionalProjectnatures> + <classpathContainers> + <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer> + <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer> + </classpathContainers> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee</artifactId> + <version>${sbs.version}</version> + <type>jar</type> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee-all</artifactId> + <version>${sbs.version}</version> + <type>pom</type> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.3</version> + <type>jar</type> + <scope>provided</scope> + </dependency> + <!-- The following dependencies are for unit testing--> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-library</artifactId> + <version>${scala.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.4</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.specs</groupId> + <artifactId>specs</artifactId> + <version>1.2.5</version> + <scope>test</scope> + </dependency> + </dependencies> + <!-- + This is where you set the Jive SBS version your plugin is compiled against. + --> + <properties> + <sbs.version>4.5.1</sbs.version> + <scala.version>2.8.0</scala.version> + </properties> +</project> diff --git a/script-plugin/src/main/assembly/assembly-plugin.xml b/script-plugin/src/main/assembly/assembly-plugin.xml new file mode 100644 index 0000000..19d01ec --- /dev/null +++ b/script-plugin/src/main/assembly/assembly-plugin.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<assembly> + <id>plugin</id> + <formats> + <format>jar</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <dependencySets> + <dependencySet> + <outputDirectory>lib</outputDirectory> + <useProjectArtifact>false</useProjectArtifact> + <scope>runtime</scope> + </dependencySet> + </dependencySets> + <fileSets> + <fileSet> + <directory>${project.build.directory}</directory> + <includes> + <include>classes/</include> + </includes> + <outputDirectory>/</outputDirectory> + </fileSet> + <fileSet> + <directory>src/main/plugin</directory> + <outputDirectory>/</outputDirectory> + <excludes> + <exclude>resources/templates/</exclude> + </excludes> + <filtered>true</filtered> + </fileSet> + <fileSet> + <directory>src/main/plugin/resources/templates</directory> + <outputDirectory>/resources/templates</outputDirectory> + </fileSet> + </fileSets> +</assembly> diff --git a/script-plugin/src/main/plugin/cache-config.xml b/script-plugin/src/main/plugin/cache-config.xml new file mode 100644 index 0000000..915b043 --- /dev/null +++ b/script-plugin/src/main/plugin/cache-config.xml @@ -0,0 +1,5 @@ +<cache-config> + <cache-mapping> + </cache-mapping> +</cache-config> + diff --git a/script-plugin/src/main/plugin/plugin.xml b/script-plugin/src/main/plugin/plugin.xml new file mode 100644 index 0000000..d8dc3f4 --- /dev/null +++ b/script-plugin/src/main/plugin/plugin.xml @@ -0,0 +1,23 @@ +<plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://www.jivesoftware.com/schemas/clearspace/2_5/plugin.xsd"> + <name>script-plugin</name> + <description>script-plugin</description> + <author></author> + <version>1.0.0</version> + <minServerVersion>4.5.0</minServerVersion> + <!-- you will want to change your class name here! --> + <class>SamplePlugin</class> + + <!-- The <components> element contains additions or customizations to + components in the user interface. Each <component> child element + represents a different UI piece, with its id attribute value + specifying which piece is being customized. + + Here, you're customizing the user bar (the menu bar at the top of + each Clearspace page) so that its Browse menu gets a new entry + item, "Say Hello". The <url> element here specifies the URL that + Clearspace will load when the user clicks the item. In this + case, Clearspace will execute the sayhello action (which is defined + in the xwork-plugin.xml file). + --> +</plugin> diff --git a/script-plugin/src/main/plugin/resources/images/readme.txt b/script-plugin/src/main/plugin/resources/images/readme.txt new file mode 100644 index 0000000..e00d6e3 --- /dev/null +++ b/script-plugin/src/main/plugin/resources/images/readme.txt @@ -0,0 +1 @@ +Place images here diff --git a/script-plugin/src/main/plugin/resources/script/jquery-1.4.2.min.js b/script-plugin/src/main/plugin/resources/script/jquery-1.4.2.min.js new file mode 100644 index 0000000..7c24308 --- /dev/null +++ b/script-plugin/src/main/plugin/resources/script/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? +e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= +j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, +"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= +true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| +c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", +L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, +"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ +a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], +d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== +a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& +!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= +true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", +i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", +" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= +this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= +e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= +null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, +"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= +a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, +isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= +{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; +if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& +!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, +toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, +u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), +function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; +if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; +for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- +1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, +CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, +relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= +l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; +h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= +m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| +!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= +h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, +gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; +c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? +a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& +this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| +u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== +1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); +this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], +"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, +animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= +j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); +this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| +c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? +function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= +this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; +k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& +f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/script-plugin/src/main/plugin/resources/script/jquery.console.js b/script-plugin/src/main/plugin/resources/script/jquery.console.js new file mode 100644 index 0000000..ce439a6 --- /dev/null +++ b/script-plugin/src/main/plugin/resources/script/jquery.console.js @@ -0,0 +1,624 @@ +// JQuery Console 1.0 +// Sun Feb 21 20:28:47 GMT 2010 +// +// Copyright 2010 Chris Done, Simon David Pratt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// 1. Redistributions of source code must retain the above +// copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// TESTED ON +// Internet Explorer 6 +// Opera 10.01 +// Chromium 4.0.237.0 (Ubuntu build 31094) +// Firefox 3.5.8, 3.6.2 (Mac) +// Safari 4.0.5 (6531.22.7) (Mac) +// Google Chrome 5.0.375.55 (Mac) + +(function($){ + $.fn.console = function(config){ + //////////////////////////////////////////////////////////////////////// + // Constants + // Some are enums, data types, others just for optimisation + var keyCodes = { + // left + 37: moveBackward, + // right + 39: moveForward, + // up + 38: previousHistory, + // down + 40: nextHistory, + // backspace + 8: backDelete, + // delete + 46: forwardDelete, + // end + 35: moveToEnd, + // start + 36: moveToStart, + // return + 13: commandTrigger, + // tab + 18: doNothing + }; + var ctrlCodes = { + // C-a + 65: moveToStart, + // C-e + 69: moveToEnd, + // C-d + 68: forwardDelete, + // C-n + 78: nextHistory, + // C-p + 80: previousHistory, + // C-b + 66: moveBackward, + // C-f + 70: moveForward, + // C-k + 75: deleteUntilEnd + }; + var altCodes = { + // M-f + 70: moveToNextWord, + // M-b + 66: moveToPreviousWord, + // M-d + 68: deleteNextWord + }; + var cursor = '<span class="jquery-console-cursor">&nbsp;</span>'; + // Opera only works with this character, not <wbr> or &shy;, + // but IE6 displays this character, which is bad, so just use + // it on Opera. + var wbr = $.browser.opera? '&#8203;' : ''; + + //////////////////////////////////////////////////////////////////////// + // Globals + var container = $(this); + var inner = $('<div class="jquery-console-inner"></div>'); + var typer = $('<input class="jquery-console-typer" type="text">'); + // Prompt + var promptBox; + var prompt; + var promptLabel = config && config.promptLabel? config.promptLabel : "> "; + var continuedPromptLabel = config && config.continuedPromptLabel? + config.continuedPromptLabel : "> "; + var column = 0; + var promptText = ''; + var restoreText = ''; + var continuedText = ''; + // Prompt history stack + var history = []; + var ringn = 0; + // For reasons unknown to The Sword of Michael himself, Opera + // triggers and sends a key character when you hit various + // keys like PgUp, End, etc. So there is no way of knowing + // when a user has typed '#' or End. My solution is in the + // typer.keydown and typer.keypress functions; I use the + // variable below to ignore the keypress event if the keydown + // event succeeds. + var cancelKeyPress = 0; + // When this value is false, the prompt will not respond to input + var acceptInput = true; + // When this value is true, the command has been canceled + var cancelCommand = false; + + // External exports object + var extern = {}; + + //////////////////////////////////////////////////////////////////////// + // Main entry point + (function(){ + container.append(inner); + inner.append(typer); + typer.css({position:'absolute',top:0,left:'-9999px'}); + if (config.welcomeMessage) + message(config.welcomeMessage,'jquery-console-welcome'); + newPromptBox(); + if (config.autofocus) { + inner.addClass('jquery-console-focus'); + typer.focus(); + setTimeout(function(){ + inner.addClass('jquery-console-focus'); + typer.focus(); + },100); + } + extern.inner = inner; + extern.typer = typer; + extern.scrollToBottom = scrollToBottom; + })(); + + //////////////////////////////////////////////////////////////////////// + // Reset terminal + extern.reset = function(){ + var welcome = (typeof config.welcomeMessage != 'undefined'); + inner.parent().fadeOut(function(){ + inner.find('div').each(function(){ + if (!welcome) { + $(this).remove(); + } else { + welcome = false; + } + }); + newPromptBox(); + inner.parent().fadeIn(function(){ + inner.addClass('jquery-console-focus'); + typer.focus(); + }); + }); + }; + + //////////////////////////////////////////////////////////////////////// + // Reset terminal + extern.notice = function(msg,style){ + var n = $('<div class="notice"></div>').append($('<div></div>').text(msg)) + .css({visibility:'hidden'}); + container.append(n); + var focused = true; + if (style=='fadeout') + setTimeout(function(){ + n.fadeOut(function(){ + n.remove(); + }); + },4000); + else if (style=='prompt') { + var a = $('<br/><div class="action"><a href="javascript:">OK</a><div class="clear"></div></div>'); + n.append(a); + focused = false; + a.click(function(){ n.fadeOut(function(){ n.remove();inner.css({opacity:1}) }); }); + } + var h = n.height(); + n.css({height:'0px',visibility:'visible'}) + .animate({height:h+'px'},function(){ + if (!focused) inner.css({opacity:0.5}); + }); + n.css('cursor','default'); + return n; + }; + + //////////////////////////////////////////////////////////////////////// + // Make a new prompt box + function newPromptBox() { + column = 0; + promptText = ''; + ringn = 0; // Reset the position of the history ring + enableInput(); + promptBox = $('<div class="jquery-console-prompt-box"></div>'); + var label = $('<span class="jquery-console-prompt-label"></span>'); + var labelText = extern.continuedPrompt? continuedPromptLabel : promptLabel; + promptBox.append(label.text(labelText).show()); + label.html(label.html().replace(' ','&nbsp;')); + prompt = $('<span class="jquery-console-prompt"></span>'); + promptBox.append(prompt); + inner.append(promptBox); + updatePromptDisplay(); + }; + + //////////////////////////////////////////////////////////////////////// + // Handle setting focus + container.click(function(){ + inner.addClass('jquery-console-focus'); + inner.removeClass('jquery-console-nofocus'); + typer.focus(); + scrollToBottom(); + return false; + }); + + //////////////////////////////////////////////////////////////////////// + // Handle losing focus + typer.blur(function(){ + inner.removeClass('jquery-console-focus'); + inner.addClass('jquery-console-nofocus'); + }); + + //////////////////////////////////////////////////////////////////////// + // Handle key hit before translation + // For picking up control characters like up/left/down/right + + typer.keydown(function(e){ + cancelKeyPress = 0; + var keyCode = e.keyCode; + // C-c: cancel the execution + if(e.ctrlKey && keyCode == 67) { + cancelKeyPress = keyCode; + cancelExecution(); + return false; + } + if (acceptInput) { + if (keyCode in keyCodes) { + cancelKeyPress = keyCode; + (keyCodes[keyCode])(); + return false; + } else if (e.ctrlKey && keyCode in ctrlCodes) { + cancelKeyPress = keyCode; + (ctrlCodes[keyCode])(); + return false; + } else if (e.altKey && keyCode in altCodes) { + cancelKeyPress = keyCode; + (altCodes[keyCode])(); + return false; + } + } + }); + + //////////////////////////////////////////////////////////////////////// + // Handle key press + typer.keypress(function(e){ + var keyCode = e.keyCode || e.which; + if (isIgnorableKey(e)) { + return false; + } + if (acceptInput && cancelKeyPress != keyCode && keyCode >= 32){ + if (cancelKeyPress) return false; + if (typeof config.charInsertTrigger == 'undefined' || + (typeof config.charInsertTrigger == 'function' && + config.charInsertTrigger(keyCode,promptText))) + typer.consoleInsert(keyCode); + } + if ($.browser.webkit) return false; + }); + + function isIgnorableKey(e) { + // for now just filter alt+tab that we receive on some platforms when + // user switches windows (goes away from the browser) + return ((e.keyCode == keyCodes.tab || e.keyCode == 192) && e.altKey); + }; + + //////////////////////////////////////////////////////////////////////// + // Rotate through the command history + function rotateHistory(n){ + if (history.length == 0) return; + ringn += n; + if (ringn < 0) ringn = history.length; + else if (ringn > history.length) ringn = 0; + var prevText = promptText; + if (ringn == 0) { + promptText = restoreText; + } else { + promptText = history[ringn - 1]; + } + if (config.historyPreserveColumn) { + if (promptText.length < column + 1) { + column = promptText.length; + } else if (column == 0) { + column = promptText.length; + } + } else { + column = promptText.length; + } + updatePromptDisplay(); + }; + + function previousHistory() { + rotateHistory(-1); + }; + + function nextHistory() { + rotateHistory(1); + }; + + // Add something to the history ring + function addToHistory(line){ + history.push(line); + restoreText = ''; + }; + + // Delete the character at the current position + function deleteCharAtPos(){ + if (column < promptText.length){ + promptText = + promptText.substring(0,column) + + promptText.substring(column+1); + restoreText = promptText; + return true; + } else return false; + }; + + function backDelete() { + if (moveColumn(-1)){ + deleteCharAtPos(); + updatePromptDisplay(); + } + }; + + function forwardDelete() { + if (deleteCharAtPos()) + updatePromptDisplay(); + }; + + function deleteUntilEnd() { + while(deleteCharAtPos()) { + updatePromptDisplay(); + } + }; + + function deleteNextWord() { + // A word is defined within this context as a series of alphanumeric + // characters. + // Delete up to the next alphanumeric character + while(column < promptText.length && + !isCharAlphanumeric(promptText[column])) { + deleteCharAtPos(); + updatePromptDisplay(); + } + // Then, delete until the next non-alphanumeric character + while(column < promptText.length && + isCharAlphanumeric(promptText[column])) { + deleteCharAtPos(); + updatePromptDisplay(); + } + }; + + //////////////////////////////////////////////////////////////////////// + // Validate command and trigger it if valid, or show a validation error + function commandTrigger() { + var line = promptText; + if (typeof config.commandValidate == 'function') { + var ret = config.commandValidate(line); + if (ret == true || ret == false) { + if (ret) { + handleCommand(); + } + } else { + commandResult(ret,"jquery-console-message-error"); + } + } else { + handleCommand(); + } + }; + + // Scroll to the bottom of the view + function scrollToBottom() { + inner.attr({ scrollTop: inner.attr("scrollHeight") });; + }; + + function cancelExecution() { + if(typeof config.cancelHandle == 'function') { + config.cancelHandle(); + } + } + + //////////////////////////////////////////////////////////////////////// + // Handle a command + function handleCommand() { + if (typeof config.commandHandle == 'function') { + disableInput(); + addToHistory(promptText); + var text = promptText; + if (extern.continuedPrompt) { + if (continuedText) + continuedText += '\n' + promptText; + else continuedText = promptText; + } else continuedText = undefined; + if (continuedText) text = continuedText; + var ret = config.commandHandle(text,function(msgs){ + commandResult(msgs); + }); + if (extern.continuedPrompt && !continuedText) + continuedText = promptText; + if (typeof ret == 'boolean') { + if (ret) { + // Command succeeded without a result. + commandResult(); + } else { + commandResult('Command failed.', + "jquery-console-message-error"); + } + } else if (typeof ret == "string") { + commandResult(ret,"jquery-console-message-success"); + } else if (typeof ret == 'object' && ret.length) { + commandResult(ret); + } else if (extern.continuedPrompt) { + commandResult(); + } + } + }; + + //////////////////////////////////////////////////////////////////////// + // Disable input + function disableInput() { + acceptInput = false; + }; + + // Enable input + function enableInput() { + acceptInput = true; + } + + //////////////////////////////////////////////////////////////////////// + // Reset the prompt in invalid command + function commandResult(msg,className) { + column = -1; + updatePromptDisplay(); + if (typeof msg == 'string') { + message(msg,className); + } else { + for (var x in msg) { + var ret = msg[x]; + message(ret.msg,ret.className); + } + } + newPromptBox(); + }; + + //////////////////////////////////////////////////////////////////////// + // Display a message + function message(msg,className) { + var mesg = $('<div class="jquery-console-message"></div>'); + if (className) mesg.addClass(className); + mesg.filledText(msg).hide(); + inner.append(mesg); + mesg.show(); + }; + + //////////////////////////////////////////////////////////////////////// + // Handle normal character insertion + typer.consoleInsert = function(keyCode){ + // TODO: remove redundant indirection + var char = String.fromCharCode(keyCode); + var before = promptText.substring(0,column); + var after = promptText.substring(column); + promptText = before + char + after; + moveColumn(1); + restoreText = promptText; + updatePromptDisplay(); + }; + + //////////////////////////////////////////////////////////////////////// + // Move to another column relative to this one + // Negative means go back, positive means go forward. + function moveColumn(n){ + if (column + n >= 0 && column + n <= promptText.length){ + column += n; + return true; + } else return false; + }; + + function moveForward() { + if(moveColumn(1)) { + updatePromptDisplay(); + return true; + } + return false; + }; + + function moveBackward() { + if(moveColumn(-1)) { + updatePromptDisplay(); + return true; + } + return false; + }; + + function moveToStart() { + if (moveColumn(-column)) + updatePromptDisplay(); + }; + + function moveToEnd() { + if (moveColumn(promptText.length-column)) + updatePromptDisplay(); + }; + + function moveToNextWord() { + while(column < promptText.length && + !isCharAlphanumeric(promptText[column]) && + moveForward()) { + } + while(column < promptText.length && + isCharAlphanumeric(promptText[column]) && + moveForward()) { + } + }; + + function moveToPreviousWord() { + // Move backward until we find the first alphanumeric + while(column -1 >= 0 && + !isCharAlphanumeric(promptText[column-1]) && + moveBackward()) { + } + // Move until we find the first non-alphanumeric + while(column -1 >= 0 && + isCharAlphanumeric(promptText[column-1]) && + moveBackward()) { + } + }; + + function isCharAlphanumeric(charToTest) { + if(typeof charToTest == 'string') { + var code = charToTest.charCodeAt(); + return (code >= 'A'.charCodeAt() && code <= 'Z'.charCodeAt()) || + (code >= 'a'.charCodeAt() && code <= 'z'.charCodeAt()) || + (code >= '0'.charCodeAt() && code <= '9'.charCodeAt()); + } + return false; + }; + + function doNothing() {}; + + extern.promptText = function(text){ + if (text) { + promptText = text; + column = promptText.length; + updatePromptDisplay(); + } + return promptText; + }; + + //////////////////////////////////////////////////////////////////////// + // Update the prompt display + function updatePromptDisplay(){ + var line = promptText; + var html = ''; + if (column > 0 && line == ''){ + // When we have an empty line just display a cursor. + html = cursor; + } else if (column == promptText.length){ + // We're at the end of the line, so we need to display + // the text *and* cursor. + html = htmlEncode(line) + cursor; + } else { + // Grab the current character, if there is one, and + // make it the current cursor. + var before = line.substring(0, column); + var current = line.substring(column,column+1); + if (current){ + current = + '<span class="jquery-console-cursor">' + + htmlEncode(current) + + '</span>'; + } + var after = line.substring(column+1); + html = htmlEncode(before) + current + htmlEncode(after); + } + prompt.html(html); + scrollToBottom(); + }; + + // Simple HTML encoding + // Simply replace '<', '>' and '&' + // TODO: Use jQuery's .html() trick, or grab a proper, fast + // HTML encoder. + function htmlEncode(text){ + return ( + text.replace(/&/g,'&amp;') + .replace(/</g,'&lt;') + .replace(/</g,'&lt;') + .replace(/ /g,'&nbsp;') + .replace(/([^<>&]{10})/g,'$1<wbr>&shy;' + wbr) + ); + }; + + return extern; + }; + // Simple utility for printing messages + $.fn.filledText = function(txt){ + $(this).text(txt); + $(this).html($(this).html().replace(/\n/g,'<br/>')); + return this; + }; +})(jQuery); diff --git a/script-plugin/src/main/plugin/resources/script/readme.txt b/script-plugin/src/main/plugin/resources/script/readme.txt new file mode 100644 index 0000000..a82eab2 --- /dev/null +++ b/script-plugin/src/main/plugin/resources/script/readme.txt @@ -0,0 +1 @@ +Place Javascript files here \ No newline at end of file diff --git a/script-plugin/src/main/plugin/resources/styles/readme.txt b/script-plugin/src/main/plugin/resources/styles/readme.txt new file mode 100644 index 0000000..84cb3db --- /dev/null +++ b/script-plugin/src/main/plugin/resources/styles/readme.txt @@ -0,0 +1 @@ +Place CSS files here \ No newline at end of file diff --git a/script-plugin/src/main/plugin/resources/templates/demo.ftl b/script-plugin/src/main/plugin/resources/templates/demo.ftl new file mode 100644 index 0000000..f1bd696 --- /dev/null +++ b/script-plugin/src/main/plugin/resources/templates/demo.ftl @@ -0,0 +1,193 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <title>JQuery Console Demo</title> + <meta name="Content-Type" content="text/html; charset=UTF-8"> + <script type="text/javascript" src="jquery-1.4.2.min.js"></script> + <script type="text/javascript" src="jquery.console.js"></script> + <!-- Everything beyond this point is user-customized --> + <script type="text/javascript"> + $(document).ready(function(){ + /* First console */ + var console1 = $('<div class="console1">'); + $('body').append(console1); + var controller1 = console1.console({ + promptLabel: 'Demo> ', + commandValidate:function(line){ + if (line == "") return false; + else return true; + }, + commandHandle:function(line){ + return [{msg:"=> [12,42]", + className:"jquery-console-message-value"}, + {msg:":: [a]", + className:"jquery-console-message-type"}] + }, + autofocus:true, + animateScroll:true, + promptHistory:true, + charInsertTrigger:function(keycode,line){ + // Let you type until you press a-z + // Never allow zero. + return !line.match(/[a-z]+/) && keycode != '0'.charCodeAt(0); + } + }); + /* Second console */ + var console2 = $('<div class="console2">'); + $('body').append(console2); + var controller2 = console2.console({ + promptLabel: 'JavaScript> ', + commandValidate:function(line){ + if (line == "") return false; + else return true; + }, + commandHandle:function(line){ + try { var ret = eval(line); + if (typeof ret != 'undefined') return ret.toString(); + else return true; } + catch (e) { return e.toString(); } + }, + animateScroll:true, + promptHistory:true, + welcomeMessage:'Enter some JavaScript expressions to evaluate.' + }); + controller2.promptText('5 * 4'); + /* Third console */ + var console3CancelFlag = false; + var console3 = $('<div class="console3">'); + $('body').append(console3); + var controller3 = console3.console({ + promptLabel: 'Echo> ', + commandValidate:function(line){ + if (line == "") return false; + else return true; + }, + commandHandle:function(line,report){ + setTimeout(function() { + if(!console3CancelFlag) + report(line); + else { + report([{msg:"User interrupt", + className:"jquery-console-message-error"}]); + console3CancelFlag = false; + } + },1000); + }, + cancelHandle:function() { + console3CancelFlag = true; + }, + animateScroll:true, + promptHistory:true + }); + /* Fourth console */ + var console4 = $('<div class="console4">'); + $('body').append(console4); + var controller4 = console4.console({ + promptLabel: 'SQL> ', + continuedPromptLabel: ' -> ', + commandValidate:function(line){ + if (line == "") return false; + else return true; + }, + commandHandle:function(line,report){ + if (line.match(/;$/)) { + controller4.continuedPrompt = false; + alert("Execute: " + line); + return true; + } else { + controller4.continuedPrompt = true; + return; + } + }, + promptHistory:true + }); + }); + </script> + <style type="text/css" media="screen"> + /* First console */ + div.console1 { font-size: 14px } + div.console1 div.jquery-console-inner + { width:900px; height:200px; background:#333; padding:0.5em; + overflow:auto } + div.console1 div.jquery-console-prompt-box + { color:#fff; font-family:monospace; } + div.console1 div.jquery-console-focus span.jquery-console-cursor + { background:#fefefe; color:#333; font-weight:bold } + div.console1 div.jquery-console-message-error + { color:#ef0505; font-family:sans-serif; font-weight:bold; + padding:0.1em; } + div.console1 div.jquery-console-message-value + { color:#1ad027; font-family:monospace; + padding:0.1em; } + div.console1 div.jquery-console-message-type + { color:#52666f; font-family:monospace; + padding:0.1em; } + div.console1 span.jquery-console-prompt-label { font-weight:bold } + /* Second console */ + div.console2 { font-size: 14px; margin-top:1em } + div.console2 div.jquery-console-inner + { width:900px; height:200px; background:#efefef; padding:0.5em; + overflow:auto } + div.console2 div.jquery-console-prompt-box + { color:#444; font-family:monospace; } + div.console2 div.jquery-console-focus span.jquery-console-cursor + { background:#333; color:#eee; font-weight:bold } + div.console2 div.jquery-console-message-error + { color:#ef0505; font-family:sans-serif; font-weight:bold; + padding:0.1em; } + div.console2 div.jquery-console-message-success + { color:#187718; font-family:monospace; + padding:0.1em; } + div.console2 span.jquery-console-prompt-label { font-weight:bold } + /* Third console */ + div.console3 { font-size: 14px; margin-top:1em } + div.console3 div.jquery-console-inner + { width:900px; height:200px; background:#efefef; padding:0.5em; + overflow:auto } + div.console3 div.jquery-console-prompt-box + { color:#444; font-family:monospace; } + div.console3 div.jquery-console-focus span.jquery-console-cursor + { background:#333; color:#eee; font-weight:bold } + div.console3 div.jquery-console-message-error + { color:#ef0505; font-family:sans-serif; font-weight:bold; + padding:0.1em; } + div.console3 div.jquery-console-message-success + { color:#187718; font-family:monospace; + padding:0.1em; } + div.console3 span.jquery-console-prompt-label { + font-weight:bold } + /* Fourth console */ + div.console4 { font-size: 14px; margin-top:1em } + div.console4 div.jquery-console-inner + { width:900px; height:200px; background:#efefef; padding:0.5em; + overflow:auto } + div.console4 div.jquery-console-prompt-box + { color:#444; font-family:monospace; } + div.console4 div.jquery-console-focus span.jquery-console-cursor + { background:#444; color:#eee; font-weight:bold } + div.console4 div.jquery-console-message-error + { color:#ef0505; font-family:sans-serif; font-weight:bold; + padding:0.1em; } + div.console4 div.jquery-console-message-success + { color:#187718; font-family:monospace; + padding:0.1em; } + div.console4 span.jquery-console-prompt-label { font-weight:bold } + </style> + </head> + <body> + <noscript> + <p> + <strong>Please enable JavaScript or upgrade your browser.</strong> + </p> + </noscript> + <h1>Simple console demo</h1> + <p>Tested on:</p> + <ul> + <li>Internet Explorer 6</li> + <li>Opera 10.01</li> + <li>Chromium 4.0.237.0 (Ubuntu build 31094)</li> + <li>Firefox 3.5.8</li> + </ul> + </body> +</html> diff --git a/script-plugin/src/main/plugin/resources/templates/readme.txt b/script-plugin/src/main/plugin/resources/templates/readme.txt new file mode 100644 index 0000000..ea02da5 --- /dev/null +++ b/script-plugin/src/main/plugin/resources/templates/readme.txt @@ -0,0 +1 @@ +Place Freemarker templates here \ No newline at end of file diff --git a/script-plugin/src/main/plugin/schema.xml b/script-plugin/src/main/plugin/schema.xml new file mode 100644 index 0000000..f43b6b0 --- /dev/null +++ b/script-plugin/src/main/plugin/schema.xml @@ -0,0 +1,2 @@ +<schema name="script-plugin"> +</schema> \ No newline at end of file diff --git a/script-plugin/src/main/plugin/spring.xml b/script-plugin/src/main/plugin/spring.xml new file mode 100644 index 0000000..21d0a68 --- /dev/null +++ b/script-plugin/src/main/plugin/spring.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation=" + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" + default-autowire="no" default-init-method="init" default-destroy-method="destroy"> + + <bean id="module1" class="SamplePlugin"> + </bean> + + +</beans> diff --git a/script-plugin/src/main/plugin/struts.xml b/script-plugin/src/main/plugin/struts.xml new file mode 100644 index 0000000..7ce9245 --- /dev/null +++ b/script-plugin/src/main/plugin/struts.xml @@ -0,0 +1,5 @@ +<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> +<struts> + <package name="script-plugin-actions" extends="community-custom"> + </package> +</struts> diff --git a/script-plugin/src/main/resources/plugin_i18n.properties b/script-plugin/src/main/resources/plugin_i18n.properties new file mode 100644 index 0000000..1ccc605 --- /dev/null +++ b/script-plugin/src/main/resources/plugin_i18n.properties @@ -0,0 +1 @@ +#put your custom i18n values here diff --git a/script-plugin/src/main/scala/SamplePlugin.scala b/script-plugin/src/main/scala/SamplePlugin.scala new file mode 100644 index 0000000..9a8600a --- /dev/null +++ b/script-plugin/src/main/scala/SamplePlugin.scala @@ -0,0 +1,11 @@ +import com.jivesoftware.base.plugin.{Plugin,PluginManager,PluginMetaData}; + +class SamplePlugin extends Plugin { + + def destroy() = { + } + + def init() = { + } + +} diff --git a/script-plugin/src/test/scala/SamplePluginSpec.scala b/script-plugin/src/test/scala/SamplePluginSpec.scala new file mode 100644 index 0000000..d447ea2 --- /dev/null +++ b/script-plugin/src/test/scala/SamplePluginSpec.scala @@ -0,0 +1,16 @@ +import org.specs._ +import org.specs.runner.{ConsoleRunner, JUnit4} + +class SamplePluginTest extends JUnit4(SamplePluginSpec) + +object SamplePluginRunner extends ConsoleRunner(SamplePluginSpec) + +object SamplePlugin extends Specification { + "This wonderful system" should { + "save the world" in { + val list = Nil + list must beEmpty + } + } + +} diff --git a/src/test/resources/jiveHome/jive.license b/src/test/resources/jiveHome/jive.license new file mode 100644 index 0000000..f58c685 --- /dev/null +++ b/src/test/resources/jiveHome/jive.license @@ -0,0 +1,20 @@ +PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGxpY2Vuc2UgaWQ9IjIwMDkxMTAw +MjU0NSIgbmFtZT0iSml2ZSBTQlMiIHR5cGU9IkRFVkVMT1BFUiI+PGNsaWVudCBuYW1lPSIiIGNvbXBh +bnk9IkppdmUgU29mdHdhcmUiLz48bW9kdWxlIG5hbWU9Im1hcmtldHBsYWNlIiB2ZXJzaW9uPSI0LjAu +MCIgY3JlYXRpb25EYXRlPSIxMS8xMC8yMDA5IiBleHBpcmF0aW9uRGF0ZT0iMTEvMDkvMjAxMCIgcGVy +cGV0dWFsPSJmYWxzZSIgY2FwcGVkPSJmYWxzZSIgbWV0ZXJpbmdUeXBlQ29kZT0ib2NjdXBpZWRzZWF0 +cyIgbWV0ZXJlZEFsbG90bWVudD0iMTAiPjxwcm9wZXJ0eSBuYW1lPSJlZGl0aW9uIj5pbnRlcm5hbDwv +cHJvcGVydHk+PC9tb2R1bGU+PG1vZHVsZSBuYW1lPSJ3aWtpIiB2ZXJzaW9uPSI0LjAuMCIgY3JlYXRp +b25EYXRlPSIxMS8xMC8yMDA5IiBwZXJwZXR1YWw9InRydWUiIGNhcHBlZD0iZmFsc2UiLz48bW9kdWxl +IG5hbWU9ImJsb2dzIiB2ZXJzaW9uPSI0LjAuMCIgY3JlYXRpb25EYXRlPSIxMS8xMC8yMDA5IiBwZXJw +ZXR1YWw9InRydWUiIGNhcHBlZD0iZmFsc2UiLz48bW9kdWxlIG5hbWU9ImZvcnVtcyIgdmVyc2lvbj0i +NC4wLjAiIGNyZWF0aW9uRGF0ZT0iMTEvMTAvMjAwOSIgcGVycGV0dWFsPSJ0cnVlIiBjYXBwZWQ9ImZh +bHNlIi8+PHByb3BlcnR5IG5hbWU9Im51bUNsdXN0ZXJNZW1iZXJzIj4xPC9wcm9wZXJ0eT48cHJvcGVy +dHkgbmFtZT0ibWFudWFsU3VibWl0UGVyaW9kRGF5cyI+OTA8L3Byb3BlcnR5Pjxwcm9wZXJ0eSBuYW1l +PSJpbml0aWFsU3VibWl0UGVyaW9kRGF5cyI+MTU8L3Byb3BlcnR5Pjxwcm9wZXJ0eSBuYW1lPSJtYW51 +YWxTdWJtaXRXYXJuaW5nRGF5cyI+MTQ8L3Byb3BlcnR5Pjxwcm9wZXJ0eSBuYW1lPSJncmFjZVBlcmlv +ZERheXMiPjA8L3Byb3BlcnR5Pjxwcm9wZXJ0eSBuYW1lPSJ3YXJuaW5nUGVyaW9kRGF5cyI+NDU8L3By +b3BlcnR5Pjxwcm9wZXJ0eSBuYW1lPSJ3YXJuaW5nUGVyaW9kQWxsb3dhbmNlIj45MDwvcHJvcGVydHk+ +PHByb3BlcnR5IG5hbWU9ImdyYWNlUGVyaW9kQWxsb3dhbmNlIj4wPC9wcm9wZXJ0eT48c2lnbmF0dXJl +PjMwMmQwMjE1MDA5MGU4YmI4ZjIzZmZhNGU1YjJlOGQ5ZGJmNGI5ZDQ0ODVlMTMzNmJhMDIxNDE0MGM1 +MmY5NmEyOTMzN2QyOGUyZGE5YjNjMmEwYzYzZWY0ODA3ZDE8L3NpZ25hdHVyZT48L2xpY2Vuc2U+ \ No newline at end of file diff --git a/src/test/resources/jiveHome/jive_startup.xml b/src/test/resources/jiveHome/jive_startup.xml new file mode 100644 index 0000000..f4c0921 --- /dev/null +++ b/src/test/resources/jiveHome/jive_startup.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + This file stores all properties need by Jive SBS's startup process. + Property names must be in the format: "example.prop.is=value" That + will be stored as: + <example> + <prop> + <is>value</is> + </prop> + </example> + + All properties must be under the "jive" element. This file should live + in your jiveHome directory. The path to that directory should be + specified in your jive_init.xml file or by one of the other supported + mechanisms. +--> + +<!-- root element, all properties must be under this element --> + +<jive> + <!-- When setup is false, you can access the setup tool. --> + <setup>@jive.setup@</setup> + <!-- Database settings --> + <connectionProvider> + <className>com.jivesoftware.base.database.DefaultConnectionProvider + </className> + </connectionProvider> + <locale> + <characterEncoding>UTF-8</characterEncoding> + </locale> + <database> + <defaultProvider> + <username>postgres</username> + <serverURL>jdbc:postgresql://localhost:5432/jive-dev-1.0-SNAPSHOT</serverURL> + <maxConnections>25</maxConnections> + <connectionTimeout>1.0</connectionTimeout> + <driver>org.postgresql.Driver</driver> + <password>postgres</password> + <minConnections>5</minConnections> + </defaultProvider> + </database> + <log> + <debug> + <enabled>true</enabled> + </debug> + </log> +</jive> diff --git a/web/cargo b/web/cargo new file mode 100644 index 0000000..9339904 --- /dev/null +++ b/web/cargo @@ -0,0 +1,6 @@ +# When running plugins invoke like so. -DpluginDirs may be comma-delimited +# Note, this command alone will not re-build your plugins, you have to do that manually, but it will rebuild your war: +# +# mvn -DpluginDirs=/path/to/myplugin/target/myplugin -DskipTests=true -Dcargo.wait=true -P int integration-test +# +mvn -DskipTests=true -Dcargo.wait=true -P int integration-test diff --git a/web/cargo-compile-exploded b/web/cargo-compile-exploded new file mode 100644 index 0000000..849a6f2 --- /dev/null +++ b/web/cargo-compile-exploded @@ -0,0 +1,9 @@ +# When running plugins invoke like so. -DpluginDirs may be comma-delimited +# Note: this command alone will not re-build your plugins, you have to do that manually. +# Note: This command compiles java classes, copies resources (spring-etc.xml, theme, etc) and runs cargo with the +# exploded directory instead of the packaged war. This saves time during development. +# +# mvn compile war:exploded -DpluginDirs=/path/to/myplugin/target/myplugin -P dev cargo:start +# + +mvn compile war:exploded -P dev cargo:start diff --git a/web/cargo-start b/web/cargo-start new file mode 100644 index 0000000..ca8d81d --- /dev/null +++ b/web/cargo-start @@ -0,0 +1,7 @@ +# When running plugins invoke like so. -DpluginDirs may be comma-delimited +# Note, this command alone will not re-build your plugins, you have to do that manually, but it will rebuild your war: +# +# mvn -Djive.devMode=true -DpluginDirs=/path/to/myplugin/target/myplugin -DskipTests=true -Dcargo.wait=true -P int integration-test +# + +mvn -Djive.devMode=true -Dcargo.wait=true -P int cargo:start diff --git a/web/pom.xml b/web/pom.xml new file mode 100644 index 0000000..f580c65 --- /dev/null +++ b/web/pom.xml @@ -0,0 +1,519 @@ +<!-- + The web pom is where we build a new custom war (overlay and custom files are copied into your WEB-INF/classes of the war) + and run and test things via Cargo. Running package here will not trigger a re-build of any plugins referenced in your parent + pom. However, the pluginDirs mojo will detect any sibling plugins and supply them to Cargo, so that all your project's plugins + will be run. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <name>weboverlay</name> + <modelVersion>4.0.0</modelVersion> + <groupId>com.syncapse.jive</groupId> + <artifactId>web</artifactId> + <packaging>war</packaging> + <version>1.0-SNAPSHOT</version> + <description> + Custom Jive SBS war. We try to only place files in this project that MUST be overlayed. + Usually this means there is no way to make the change as a plugin. Most customizations can be done by plugin these days, and there + are many advantages to doing so in terms of packaging, deployment, upgradability and debugging. + Overlaying a file ensures that you will have to put forth at least some development effort when you want to upgrade versions + of Jive SBS. + </description> + + <parent> + <groupId>com.syncapse.jive</groupId> + <artifactId>jive-dev</artifactId> + <version>1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + + <build> + <finalName> + ${customer.name}-${customer.version}-sbs-${sbs.version} + </finalName> + <resources> + <resource> + <directory>${basedir}/src/main/resources-filtered</directory> + <filtering>true</filtering> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.6</source> <!-- compiling with JDK 6 now --> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <!-- If you are making use of the Cobertura reports, they generate a .ser file that must be deleted, or your + coverage data will be corrupted on successive runs + --> + <execution> + <id>delete-cobertura-ser</id> + <phase>clean</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <echo message="deleting cobertura.ser" /> + <delete file="${basedir}/cobertura.ser" failonerror="false"/> + </tasks> + </configuration> + </execution> + <execution> + <id>compile-sbs-artifacts</id> + <phase>compile</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <tasks> + <!-- Copy themes files into ../target/jiveHome/themes for testing --> + <copy todir="${basedir}/../target/jiveHome/themes" overwrite="true"> + <fileset dir="${basedir}/src/main/themes"> + <include name="**/*" /> + </fileset> + </copy> + <!-- Now build a new themes.zip for distribution --> + <mkdir dir="${project.build.directory}/themes"/> + <copy todir="${project.build.directory}/themes" overwrite="yes" filtering="off"> + <fileset dir="${basedir}/src/main/themes" + includes="**/*" excludes="**/.svn, **/.svn/**" /> + </copy> + <zip destfile="${project.build.directory}/themes.zip"> + <zipfileset dir="${project.build.directory}/themes" prefix=""/> + </zip> + <!-- Copy your etc directory to ../target/jiveHome for testing--> + <mkdir dir="../target/jiveHome/etc"/> + <copy todir="../target/jiveHome/etc" overwrite="true"> + <fileset dir="src/main/etc"> + <include name="*.xml"/> + </fileset> + </copy> + <!-- Build an etc.zip for distribution--> + <zip destfile="${project.build.directory}/etc.zip"> + <zipfileset dir="${basedir}/src/main/etc" prefix=""/> + </zip> + + <!-- Copy your etc directory to ../target/jiveHome for testing--> + <mkdir dir="../target/jiveHome/keys"/> + <copy todir="../target/jiveHome/keys" overwrite="true"> + <fileset dir="${basedir}/src/main/keys"> + <include name="*.der"/> + </fileset> + </copy> + <!-- Build an keys.zip for distribution--> + <zip destfile="${project.build.directory}/keys.zip"> + <zipfileset dir="${basedir}/src/main/keys" prefix=""/> + </zip> + + </tasks> + </configuration> + </execution> + <!-- The execution below should be used when a project needs to overlay any Jive SBS bean.properties + or resources in the Jive SBS directory "resources.scripts". In order for these overlay files + to actually override their equivalents in the Jive SBS jar, they need to be placed in the + Jive SBS jar itself. --> + <!--<execution>--> + <!--<id>repackage-sbs-jar</id>--> + <!--<phase>package</phase>--> + <!--<goals>--> + <!--<goal>run</goal>--> + <!--</goals>--> + <!--<configuration>--> + <!--<tasks>--> + <!--Overlay items in the overlay directory into the jar distributed in the war --> + <!--<unjar src="./target/${build.finalName}/WEB-INF/lib/jive-sbs-employee-${sbs.shortversion}.jar"--> + <!--dest="./target/jive-sbs-employee-temp-${sbs.shortversion}" />--> + <!--<copy todir="./target/jive-sbs-employee-temp-${sbs.shortversion}" overwrite="true">--> + <!--<fileset dir="./src/main/overlay/" includes="**/*"/>--> + <!--</copy>--> + <!--<taskdef name="yui-compressor"--> + <!--classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask"--> + <!--classpathref="maven.dependency.classpath"/>--> + + <!--<yui-compressor--> + <!--warn="false"--> + <!--munge="true"--> + <!--preserveallsemicolons="false"--> + <!--todir="./target/jive-sbs-employee-temp-${sbs.shortversion}"--> + <!--fromdir="./src/main/overlay"--> + <!--charset="utf8">--> + <!--</yui-compressor>--> + <!--<jar jarfile="./target/${build.finalName}/WEB-INF/lib/jive-sbs-employee-${sbs.shortversion}.jar" update="false">--> + <!--<fileset dir="./target/jive-sbs-employee-temp-${sbs.shortversion}" includes="**/*"/>--> + <!--</jar>--> + <!--<jar destfile="./target/${build.finalName}.war">--> + <!--<fileset dir="./target/${build.finalName}"/>--> + <!--</jar>--> + <!--</tasks>--> + <!--</configuration>--> + <!--</execution>--> + </executions> + </plugin> + <plugin> + <!-- Surefire is our unit testing framework of choice--> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <!-- Don't suck up selenium tests in there--> + <excludes> + <exclude>**/selenium/*Test.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.0</version> + <configuration> + <workingDirectory>${basedir}/target/tmp</workingDirectory> + </configuration> + </plugin> + + </plugins> + </build> + <!-- These properties are set by a TeamCity CI server. They get populated into the customer_version.jsp that + is copied into our war file at the root. This gives you web-accessible, definitive build information --> + <properties> + <build.number>${env.BUILD_NUMBER}</build.number> + <build.vcs.number>${env.BUILD_VCS_NUMBER.1}</build.vcs.number> + <build.project.name>${env.TEAMCITY_PROJECT_NAME}</build.project.name> + </properties> + <dependencies> + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee</artifactId> <!-- was clearspacex --> + <version>${sbs.version}</version> + <type>war</type> + </dependency> + + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee</artifactId> <!-- was clearspacex --> + <version>${sbs.version}</version> + <type>jar</type> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>com.jivesoftware</groupId> + <artifactId>jive-sbs-employee-all</artifactId> <!-- was clearspacex-all --> + <version>${sbs.version}</version> + <type>pom</type> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>compile</scope> + </dependency> + <!-- We assume your jdbc jars will be provided at runtime--> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.5</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>8.3-603.jdbc3</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.openqa.selenium.client-drivers</groupId> + <artifactId>selenium-java-client-driver</artifactId> + <version>0.9.2</version> + <scope>test</scope> + </dependency> + <!-- The dependencies below should be used when a project needs to overlay any resources in the Jive SBS + directory "resources.scripts". In order for the minimized Javascript files to be generated, these + dependencies must be present so the yui-compressor task can run --> + <!--<dependency>--> + <!--<groupId>com.jivesoftware</groupId>--> + <!--<artifactId>yuicompressor</artifactId>--> + <!--<version>2.2.4_2_0_0_rc1</version>--> + <!--</dependency>--> + <!--<dependency>--> + <!--<groupId>com.jivesoftware</groupId>--> + <!--<artifactId>yuicompressor-anttask</artifactId>--> + <!--<version>2.4.2</version>--> + <!--</dependency>--> + </dependencies> + <profiles> + <profile> + <id>int</id> + <build> + <plugins> + <!-- Cargo is our main method of running and testing/debugging SBS. This is the main configuration area. --> + <!-- Here is the config reference: http://cargo.codehaus.org/Maven2+Plugin+Reference+Guide --> + <plugin> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-maven2-plugin</artifactId> + <version>1.0</version> + <configuration> + <!-- Feed them this value; Decides if Cargo should wait after the container is started or not --> + <wait>${cargo.wait}</wait> + <container> + <containerId>tomcat6x</containerId> + <home>${tomcat6.home}</home> + <systemProperties> + <jive.instance.home>${basedir}/../target/jiveHome</jive.instance.home> + <jive.ws.disabled>true</jive.ws.disabled> + <jive.devMode>true</jive.devMode> + <themes.directory>${basedir}/src/main/themes</themes.directory> + <!-- <pluginDirs>${basedir}/../myplugin/target/myplugin</pluginDirs> --> + </systemProperties> + <dependencies> + <!-- Throw in our most common jdbc connectors; add yours here if it's missing --> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <type>jar</type> + </dependency> + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + </dependency> + </dependencies> + </container> + <configuration> + <home>target/tomcat6x</home> + <properties> + <cargo.jvmargs>-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC</cargo.jvmargs> + </properties> + <deployables> + <deployable> + <location>target/${customer.name}-${customer.version}-sbs-${sbs.version}.war</location> + <pingURL>http://localhost:8080/jive</pingURL> + <properties> + <context>jive</context> + </properties> + </deployable> + </deployables> + </configuration> + </configuration> + <executions> + <execution> + <id>start-container</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + </execution> + <execution> + <id>stop-container</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Selenium Server Plugin + http://mojo.codehaus.org/selenium-maven-plugin/usage.html--> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>selenium-maven-plugin</artifactId> + <version>1.0-beta-3-SNAPSHOT</version> + <executions> + <execution> + <id>start</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start-server</goal> + </goals> + <configuration> + <background>true</background> + </configuration> + </execution> + <execution> + <id>stop</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop-server</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Surefire plugin for unit testing: + http://maven.apache.org/plugins/maven-surefire-plugin/usage.html--> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>surefire-it</id> + <phase>integration-test</phase> + <goals> + <goal>test</goal> + </goals> + <configuration> + <excludes> + <exclude>none</exclude> + </excludes> + <includes> + <include>**/selenium/*Test.java</include> + </includes> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + + </build> + </profile> + + <!-- This profile creates a cargo configuration that runs Tomcat with the exploded war. Running with the exploded war reduces + the time that it takes for cargo to startup Tomcat. --> + <profile> + <id>dev</id> + <build> + <plugins> + <!-- sets the pluginDirs property, which is used by Jive SBS to run plugins in dev mode --> + <plugin> + <groupId>com.jivesoftware.maven</groupId> + <artifactId>pluginDirsMojo</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>start-container</id> + <phase>pre-integration-test</phase> + <goals> + <goal>plugindirs</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Cargo is our main method of running and testing/debugging SBS. This is the main configuration area. --> + <!-- Here is the config reference: http://cargo.codehaus.org/Maven2+Plugin+Reference+Guide --> + <plugin> + <groupId>org.codehaus.cargo</groupId> + <artifactId>cargo-maven2-plugin</artifactId> + <version>1.0</version> + <configuration> + <!-- In the dev profile, cargo will always wait --> + <wait>true</wait> + <container> + <containerId>tomcat6x</containerId> + <home>${tomcat6.home}</home> + <systemProperties> + <jive.instance.home>${basedir}/../target/jiveHome</jive.instance.home> + <jive.ws.disabled>true</jive.ws.disabled> + <jive.devMode>true</jive.devMode> + <themes.directory>${basedir}/src/main/themes</themes.directory> + <docverse.enabled>false</docverse.enabled> + <rebel.struts2-plugin>true</rebel.struts2-plugin> + <!-- <pluginDirs>${basedir}/../myplugin/target/myplugin</pluginDirs> --> + </systemProperties> + <dependencies> + <!-- Throw in our most common jdbc connectors; add yours here if it's missing --> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <type>jar</type> + </dependency> + <dependency> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> + </dependency> + </dependencies> + </container> + <configuration> + <home>target/tomcat6x</home> + <properties> + <cargo.jvmargs>-noverify -javaagent:${rebel.path} -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Xms1024m -Xmx2048m -XX:MaxPermSize=512m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC</cargo.jvmargs> + <cargo.logging>low</cargo.logging> + </properties> + <deployables> + <deployable> + <location>target/${customer.name}-${customer.version}-sbs-${sbs.version}</location> + <pingURL>http://localhost:8080/jive</pingURL> + <properties> + <context>jive</context> + </properties> + </deployable> + </deployables> + </configuration> + </configuration> + </plugin> + <!-- <plugin> + <groupId>org.zeroturnaround</groupId> + <artifactId>javarebel-maven-plugin</artifactId> + <executions> + <execution> + <id>generate-rebel-xml</id> + <phase>process-resources</phase> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + <configuration> + <classpath> + <fallback>default</fallback> + <resources> + <resource> + <directory>${basedir}/../myplugin/target/classes</directory> + </resource> + <resource> + <jarset>${basedir}/../myplugin/target/dependency</jarset> + </resource> + </resources> + </classpath> + <war> + <path>${basedir}/target/${customer.name}-${customer.version}-sbs-${sbs.version}</path> + </war> + </configuration> + </plugin> --> + </plugins> + </build> + </profile> + </profiles> + <!-- + Generate reports with mvn site + --> + <reporting> + <outputDirectory>target/site</outputDirectory> + <plugins> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>surefire-report-maven-plugin</artifactId> + </plugin> + <plugin> + <artifactId>maven-pmd-plugin</artifactId> + <configuration> + <targetJdk>1.6</targetJdk> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.0</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>taglist-maven-plugin</artifactId> + <version>2.0-beta-1</version> + <configuration> + <tags>TODO,@todo,FIXME,HACK,XXX,@deprecated</tags> + </configuration> + </plugin> + </plugins> + </reporting> + + +</project> diff --git a/web/src/main/etc/spring-etc.xml b/web/src/main/etc/spring-etc.xml new file mode 100644 index 0000000..f38ae94 --- /dev/null +++ b/web/src/main/etc/spring-etc.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation=" + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" + default-autowire="no" default-init-method="init" default-destroy-method="destroy"> + + +</beans> \ No newline at end of file diff --git a/web/src/main/java/App.java b/web/src/main/java/App.java new file mode 100644 index 0000000..d6dc271 --- /dev/null +++ b/web/src/main/java/App.java @@ -0,0 +1,9 @@ +public class App { + + public App() {} + + public static void main(String args[]) { + System.out.println("Hello World!"); + } + +} \ No newline at end of file diff --git a/web/src/main/keys/readme.txt b/web/src/main/keys/readme.txt new file mode 100644 index 0000000..d4b7bc0 --- /dev/null +++ b/web/src/main/keys/readme.txt @@ -0,0 +1 @@ +put your key certs here, e.g. *.der files diff --git a/web/src/main/overlay/beans/readme.txt b/web/src/main/overlay/beans/readme.txt new file mode 100644 index 0000000..b6065d7 --- /dev/null +++ b/web/src/main/overlay/beans/readme.txt @@ -0,0 +1 @@ +Place overridden widget properties files in this folder \ No newline at end of file diff --git a/web/src/main/overlay/resources/scripts/readme.txt b/web/src/main/overlay/resources/scripts/readme.txt new file mode 100644 index 0000000..f44ced1 --- /dev/null +++ b/web/src/main/overlay/resources/scripts/readme.txt @@ -0,0 +1 @@ +Place overridden javascript files in this folder \ No newline at end of file diff --git a/web/src/main/resources-filtered/version.properties b/web/src/main/resources-filtered/version.properties new file mode 100644 index 0000000..d9f243b --- /dev/null +++ b/web/src/main/resources-filtered/version.properties @@ -0,0 +1,3 @@ +build.number=\${build.number} +build.vcs.number=\${build.vcs.number} +build.project.name=\${build.project.name} \ No newline at end of file diff --git a/web/src/main/themes/theme.xml b/web/src/main/themes/theme.xml new file mode 100644 index 0000000..7d3cb0c --- /dev/null +++ b/web/src/main/themes/theme.xml @@ -0,0 +1,5 @@ +<theme> + <name>jive-dev</name> + <description>basic</description> +</theme> + diff --git a/web/src/main/webapp/WEB-INF/classes/jive_custom_i18n_en.properties b/web/src/main/webapp/WEB-INF/classes/jive_custom_i18n_en.properties new file mode 100644 index 0000000..e69de29 diff --git a/web/src/main/webapp/WEB-INF/classes/struts-community-custom.xml b/web/src/main/webapp/WEB-INF/classes/struts-community-custom.xml new file mode 100644 index 0000000..537e054 --- /dev/null +++ b/web/src/main/webapp/WEB-INF/classes/struts-community-custom.xml @@ -0,0 +1,12 @@ +<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" + "http://struts.apache.org/dtds/struts-2.0.dtd"> +<struts> + <package name="community-custom" extends="community-actions"> + </package> + + <package name="community-admin-custom" extends="community-admin-actions" namespace="/admin"> + </package> + + <package name="community-custom-include" extends="community-actions-include"> + </package> +</struts> diff --git a/web/src/main/webapp/WEB-INF/classes/template/readme.txt b/web/src/main/webapp/WEB-INF/classes/template/readme.txt new file mode 100644 index 0000000..ac3dfa4 --- /dev/null +++ b/web/src/main/webapp/WEB-INF/classes/template/readme.txt @@ -0,0 +1 @@ +This is a placeholder file to create the directory. diff --git a/web/src/main/webapp/WEB-INF/classes/ui-components-custom.xml b/web/src/main/webapp/WEB-INF/classes/ui-components-custom.xml new file mode 100644 index 0000000..d023763 --- /dev/null +++ b/web/src/main/webapp/WEB-INF/classes/ui-components-custom.xml @@ -0,0 +1,7 @@ +<?xml version="1.0"?> + +<components xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://www.jivesoftware.com/schemas/clearspace/1_1/ui-components.xsd"> + + +</components> diff --git a/web/src/main/webapp/WEB-INF/classes/upgrade-custom.xml b/web/src/main/webapp/WEB-INF/classes/upgrade-custom.xml new file mode 100644 index 0000000..c7d24fc --- /dev/null +++ b/web/src/main/webapp/WEB-INF/classes/upgrade-custom.xml @@ -0,0 +1,5 @@ +<upgrade-config> + <upgrades> + + </upgrades> +</upgrade-config> diff --git a/web/src/main/webapp/customer_version.jsp b/web/src/main/webapp/customer_version.jsp new file mode 100644 index 0000000..6bac337 --- /dev/null +++ b/web/src/main/webapp/customer_version.jsp @@ -0,0 +1,17 @@ +<%@ page import="java.util.Properties" %> +<%@ page import="com.jivesoftware.util.ClassUtilsImpl" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<html> + <head><title>Customer Version</title></head> + + <% + Properties versionProperties = new Properties(); + versionProperties.load(new ClassUtilsImpl().getResourceAsStream("/version.properties")); + %> + + <body> + CI Project Name = <%= versionProperties.getProperty("build.project.name") %><br/> + CI Build Number = <%= versionProperties.getProperty("build.number") %><br/> + CI Build VCS Number = <%= versionProperties.getProperty("build.vcs.number") %> + </body> +</html> \ No newline at end of file diff --git a/web/src/test/java/AppTest.java b/web/src/test/java/AppTest.java new file mode 100644 index 0000000..54c3614 --- /dev/null +++ b/web/src/test/java/AppTest.java @@ -0,0 +1,36 @@ +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}
seikichi/pumblr
41c16fa53a7a529797e14a6d6f1b8ba155d25827
add MANIFEST.in
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..afce50f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include README.rst +include README.ja.rst +include LICENSE +include MANIFEST.in +include testdata/* +recursive-include *.py
seikichi/pumblr
950ac22e3a6f04ce761f9fc68b632bd72f780be8
version up(0.1.0->0.1.1)
diff --git a/setup.py b/setup.py index 7014d85..d87603e 100644 --- a/setup.py +++ b/setup.py @@ -1,30 +1,30 @@ from setuptools import setup, find_packages import sys, os -version = '0.1.0' +version = '0.1.1' setup(name='pumblr', version=version, description="A python library for The Tumblr API.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', ], keywords='tumblr', author='seikichi', author_email='[email protected]', url='http://d.hatena.ne.jp/se-kichi', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ ], entry_points=""" # -*- Entry points: -*- """, )
seikichi/pumblr
8838bdbc98861ae2824b39663343b1c41b0b9933
modify README
diff --git a/README.ja.rst b/README.ja.rst index 63a3993..a857d76 100644 --- a/README.ja.rst +++ b/README.ja.rst @@ -1,69 +1,69 @@ ========== pumblr ========== What's this? ------------ Tumblr APIのためのライブラリ. Requirements ------------ | python 2.5 or later | simplejson (python 2.5) How to Install? --------------- :: $ easy_install pumblr setuptools ++++++++++ :: $ python setup.py install (run as admin/root) Usage ----- :: # モジュールのインポート >>> import pumblr # 特定のユーザーのpostを読む (/api/read) # seikichi.tumblr.comの場合は - >>> data = pumblr.api.read('seikichi') + >>> data = pumblr.api.read('seikichi') # 'seikichi.tumblr.com' でも可 # 認証を行う (/api/authenticate) >>> pumblr.api.auth(email='hoge@fuga', password='password') # quoteを書き込む (/api/write) >>> pumblr.api.write_quote(quote='myo---n') # dashboardを読む (/api/dashboard) >>> data = pumblr.api.dashboard() >>> p = data.posts[0] # likeを付ける (/api/like) (unlikeも同様) >>> pumblr.api.like(post_id=p.id, reblog_key=p.reblog_key) # reblogする (/api/reblog) >>> pumblr.api.reblog(post_id=p.id, reblog_key=p.reblog_key) Other ----- not implemented yet +++++++++++++++++++ * Liked posts (api/likes) * Pages reading (api/pages) * Editing posts (api/write) | | Author: seikichi | License: MIT | Mail: seikichi[at]kmc.gr.jp diff --git a/README.rst b/README.rst index b908e6e..eb77d10 100644 --- a/README.rst +++ b/README.rst @@ -1,71 +1,71 @@ ========== pumblr ========== What's this? ------------ A python library for The Tumblr API. Requirements ------------ | python 2.5 or later | simplejson (python 2.5) How to Install? --------------- easy_install ++++++++++++ :: $ easy_install pumblr setuptools ++++++++++ :: $ python setup.py install (run as admin/root) Usage ----- :: # import >>> import pumblr # read user post (/api/read) # to read 'seikichi.tumblr.com', - >>> data = pumblr.api.read('seikichi') + >>> data = pumblr.api.read('seikichi') # 'seikichi.tumblr.com' is also valid # authenticate (/api/authenticate) >>> pumblr.api.auth(email='hoge@fuga', password='password') # write quote (/api/write) >>> pumblr.api.write_quote(quote='myo---n') # read dashboard (/api/dashboard) >>> data = pumblr.api.dashboard() >>> p = data.posts[0] - # liking post(/api/like) (unliking is similar) + # liking post (/api/like) (unliking is similar) >>> pumblr.api.like(post_id=p.id, reblog_key=p.reblog_key) - # reblogging post(/api/reblog) + # reblogging post (/api/reblog) >>> pumblr.api.reblog(post_id=p.id, reblog_key=p.reblog_key) Other ----- not implemented yet +++++++++++++++++++ * Liked posts (api/likes) * Pages reading (api/pages) * Editing posts (api/write) | | Author: seikichi | License: MIT | Mail: seikichi[at]kmc.gr.jp
seikichi/pumblr
718f833c82784681bebd6a7e134e790e8e9fa685
group等を 'hoge' or 'hoge.tumblr.com' のどちらでも指定できるように
diff --git a/pumblr/api.py b/pumblr/api.py index eb875a7..3d0dbfc 100755 --- a/pumblr/api.py +++ b/pumblr/api.py @@ -1,315 +1,318 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import utils import urllib2 import functools json = utils.import_json() from models import ApiRead from errors import PumblrError, PumblrAuthError, PumblrRequestError class API(object): """Tumblr API""" def __init__(self, email=None, password=None): self._authenticated = False if email is not None and password is not None: self.auth(email, password) def _check_we_ll_be_back(self, text): # ;-p if text.startswith('<!DOCTYPE html PUBLIC'): #TODO: not cool... raise PumblrError('We\'ll be back shortly!') def _auth_check(func): """check authenticate""" @functools.wraps(func) def wrapper(self, *args, **kw): if not self._authenticated: raise PumblrError("You are not authenticated yet.") return func(self, *args, **kw) return wrapper def _check_status_code(self, url, data): """POST to url(with data) and check HTTP status code""" try: req = urllib2.urlopen(url, data) return req.read() except urllib2.HTTPError, e: if e.code == 200 or e.code == 201: return # OK if e.code == 404: raise PumblrError('incorrect reblog-key') if e.code == 403: raise PumblrAuthError(str(e)) if e.code == 400: raise PumblrRequestError(str(e)) except Exception, e: raise PumblrError(str(e)) raise PumblrError('') def _read_json_data(self, url, data=None): """open url and return json instance""" text = urllib2.urlopen(url, data).read() self._check_we_ll_be_back(text) return json.loads(utils.extract_dict(text)) def auth(self, email, password): """validate credentials""" self._email = email self._password = password self._authenticated = False url = 'http://www.tumblr.com/api/authenticate' query = dict( email=self._email, password=self._password, ) text = self._check_status_code(url, utils.urlencode(query)) self._check_we_ll_be_back(text) self._authenticated = True @_auth_check def dashboard(self, start=0, num=20, type=None, likes=0): """ Dashboard reading. Arguments: - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `likes`: (optional) 1 or 0, default 0. If 1, liked posts will have the liked="true" attribute. """ url = 'http://www.tumblr.com/api/dashboard/json' query = dict( email=self._email, password=self._password, start=start, num=num, likes=likes, type=type ) return ApiRead.parse(self._read_json_data(url, utils.urlencode(query))) def read(self, name, start=0, num=20, type=None, id=None, search=None, tagged=None): """ Reading Tumblr data. Arguments: - `name`: username - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: (optional) The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `id`: A specific post ID to return. Use instead of start, num, or type. - `search`: Search for posts with this query. - `tagged`: Return posts with this tag in reverse-chronological order (newest first). """ if id is not None: query = dict(id=id) else: query = dict( start=start, num=num, type=type, search=search, tagged=tagged ) - url = "http://%s.tumblr.com/api/read/json?%s" % (name, utils.urlencode(query)) + url = ("http://%s/api/read/json?%s" % + ((name if '.' in name else '%s.tumblr.com' % name), utils.urlencode(query))) + # url = "http://%s.tumblr.com/api/read/json?%s" % (name, utils.urlencode(query)) return ApiRead.parse(self._read_json_data(url)) def like(self, post_id, reblog_key): """ Liking post. Arguments: - `post_id`: The numeric post ID to like. - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=True) def unlike(self, post_id, reblog_key): """ Un-Liking post. Arguments: - `post_id`: The numeric post ID to like. - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=False) @_auth_check def _like_unlike(self, post_id, reblog_key, like): url = 'http://www.tumblr.com/api/%s' % ('like' if like else 'unlike') query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key } self._check_status_code(url, utils.urlencode(query)) @_auth_check def reblog(self, post_id, reblog_key, comment=None, reblog_as=None, group=None): """ Reblogging post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. - `comment`: (optional) Text, HTML, or Markdown string (see format) of the commentary added to the reblog. - `reblog_as`: (optional) Reblog as a different format from the original post. - `group`: (optional) Post this to a secondary blog on your account. """ if group is not None: - group = '%s.tumblr.com' % group + group = group if '.' in group else '%s.tumblr.com' % group url = 'http://www.tumblr.com/api/reblog' query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key, 'group':group, 'comment':comment, 'as':reblog_as, } self._check_status_code(url, utils.urlencode(query)) @_auth_check def delete(self, post_id): """ Deleting post Arguments: - `post_id`: The integer ID of the post you wish to delete. """ url = 'http://www.tumblr.com/api/delete' query = {'email':self._email, 'password':self._password, 'post-id':post_id} self._check_status_code(url, utils.urlencode(query)) def _write(f): def _wrapper(self, generator='pumblr', group=None, date=None, private=0, tags=None, slug=None, **kw): """ Write API. Arguments: - `generator`: A short description of the application - `group`: Post this to a secondary blog on your account - `date`: (optional) - The post date - `private`: (optional) 1 or 0. Whether the post is private. - `tags`: (optional) Comma-separated list of post tags. - `slug`: (optional) A custom string to appear in the post's URL \n """ url = 'http://www.tumblr.com/api/write' - if group is not None: group = '%s.tumblr.com' % group + if group is not None: + group = group if '.' in group else '%s.tumblr.com' % group query = dict( email=self._email, password=self._password, generator=generator, group=group, date=date, private=private, tags=tags, slug=slug ) query.update(f(self, **kw)) if not 'type' in query.keys(): raise PumblrError('post type is needed!') self._check_status_code(url, utils.urlencode(query)) _wrapper.__doc__ += f.__doc__ return _wrapper @_auth_check @_write def write_quote(self, quote, source=None): """ Quote Arguments: - `quote`: - `source`:(optional, HTML allowed) """ return dict(type='quote', quote=quote, source=source) @_auth_check @_write def write_regular(self, title, body): """ Regular Arguments: - `title`: - `body`:(HTML allowed) """ return dict(type='regular', title=title, body=body) @_auth_check @_write def write_link(self, url, name=None, description=None): """ Link Arguments: - `url`: - `name`:(optional) - `description`:(optional, HTML allowed) """ return dict(type='link', url=url, name=name, description=description) @_auth_check @_write def write_photo(self, source=None, data=None, caption=None, click_through_url=None): """ Requires either source or data, but not both. If both are specified, source is used. Photo Arguments: - `source`: The URL of the photo to copy. This must be a web-accessible URL, not a local file or intranet location. - `data`: An image file. - `caption`:(optional, HTML allowed) - `click_through_url`: (optional) """ query = { 'type':'photo', 'caption':caption, 'click-through-url':click_through_url } if source is not None: query['source'] = source elif data is not None: query['data'] = data else: raise PumblrError('write photo requires either source or data') return query @_auth_check @_write def write_conversation(self, conversation, title=None): """ Conversation Arguments: - `conversation`: - `title`:(optional) """ return dict( type='conversation', conversation=conversation, title=title ) @_auth_check @_write def write_audio(self, data='', externally_hosted_url=None, caption=None): """ Arguments: - `data`: An audio file. Must be MP3 or AIFF format. - `externally_hosted_url`: (optional, replaces data) - `caption`: (optional, HTML allowed) """ query = dict(type='audio', caption=caption) if externally_hosted_url is not None: query['externally-hosted-url'] = externally_hosted_url else: query['data'] = data return query @_auth_check @_write def write_video(self, embed, caption): """ Arguments: - `embed`: Either the complete HTML code to embed the video, or the URL of a YouTube video page. - `caption`: (optional, HTML allowed) """ return dict( type='video', embed=embed, caption=caption )
seikichi/pumblr
067984d6c163b28589f8d3047946c0d82227be22
modify setup.py (remove 'simplejson' in install_requires)
diff --git a/setup.py b/setup.py index 3559ff9..7014d85 100644 --- a/setup.py +++ b/setup.py @@ -1,31 +1,30 @@ from setuptools import setup, find_packages import sys, os version = '0.1.0' setup(name='pumblr', version=version, description="A python library for The Tumblr API.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', ], keywords='tumblr', author='seikichi', author_email='[email protected]', url='http://d.hatena.ne.jp/se-kichi', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ - 'simplejson' ], entry_points=""" # -*- Entry points: -*- """, )
seikichi/pumblr
455e6ad77221a3a557661154947350cee4ac9be4
add optional params to write api.
diff --git a/pumblr/api.py b/pumblr/api.py index e9ec7ee..eb875a7 100755 --- a/pumblr/api.py +++ b/pumblr/api.py @@ -1,307 +1,315 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import utils import urllib2 import functools json = utils.import_json() from models import ApiRead from errors import PumblrError, PumblrAuthError, PumblrRequestError class API(object): """Tumblr API""" def __init__(self, email=None, password=None): self._authenticated = False if email is not None and password is not None: self.auth(email, password) def _check_we_ll_be_back(self, text): # ;-p if text.startswith('<!DOCTYPE html PUBLIC'): #TODO: not cool... raise PumblrError('We\'ll be back shortly!') def _auth_check(func): """check authenticate""" @functools.wraps(func) def wrapper(self, *args, **kw): if not self._authenticated: raise PumblrError("You are not authenticated yet.") return func(self, *args, **kw) return wrapper def _check_status_code(self, url, data): """POST to url(with data) and check HTTP status code""" try: req = urllib2.urlopen(url, data) return req.read() except urllib2.HTTPError, e: if e.code == 200 or e.code == 201: return # OK if e.code == 404: raise PumblrError('incorrect reblog-key') if e.code == 403: raise PumblrAuthError(str(e)) if e.code == 400: raise PumblrRequestError(str(e)) except Exception, e: raise PumblrError(str(e)) raise PumblrError('') def _read_json_data(self, url, data=None): """open url and return json instance""" text = urllib2.urlopen(url, data).read() self._check_we_ll_be_back(text) return json.loads(utils.extract_dict(text)) def auth(self, email, password): """validate credentials""" self._email = email self._password = password self._authenticated = False url = 'http://www.tumblr.com/api/authenticate' query = dict( email=self._email, password=self._password, ) text = self._check_status_code(url, utils.urlencode(query)) self._check_we_ll_be_back(text) self._authenticated = True @_auth_check def dashboard(self, start=0, num=20, type=None, likes=0): """ Dashboard reading. Arguments: - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `likes`: (optional) 1 or 0, default 0. If 1, liked posts will have the liked="true" attribute. """ url = 'http://www.tumblr.com/api/dashboard/json' query = dict( email=self._email, password=self._password, start=start, num=num, likes=likes, type=type ) return ApiRead.parse(self._read_json_data(url, utils.urlencode(query))) def read(self, name, start=0, num=20, type=None, id=None, search=None, tagged=None): """ Reading Tumblr data. Arguments: - `name`: username - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: (optional) The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `id`: A specific post ID to return. Use instead of start, num, or type. - `search`: Search for posts with this query. - `tagged`: Return posts with this tag in reverse-chronological order (newest first). """ if id is not None: query = dict(id=id) else: query = dict( start=start, num=num, type=type, search=search, tagged=tagged ) url = "http://%s.tumblr.com/api/read/json?%s" % (name, utils.urlencode(query)) return ApiRead.parse(self._read_json_data(url)) def like(self, post_id, reblog_key): """ Liking post. Arguments: - `post_id`: The numeric post ID to like. - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=True) def unlike(self, post_id, reblog_key): """ Un-Liking post. Arguments: - `post_id`: The numeric post ID to like. - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=False) @_auth_check def _like_unlike(self, post_id, reblog_key, like): url = 'http://www.tumblr.com/api/%s' % ('like' if like else 'unlike') query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key } self._check_status_code(url, utils.urlencode(query)) @_auth_check def reblog(self, post_id, reblog_key, comment=None, reblog_as=None, group=None): """ Reblogging post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. - `comment`: (optional) Text, HTML, or Markdown string (see format) of the commentary added to the reblog. - `reblog_as`: (optional) Reblog as a different format from the original post. - `group`: (optional) Post this to a secondary blog on your account. """ if group is not None: group = '%s.tumblr.com' % group url = 'http://www.tumblr.com/api/reblog' query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key, 'group':group, 'comment':comment, 'as':reblog_as, } self._check_status_code(url, utils.urlencode(query)) @_auth_check def delete(self, post_id): """ Deleting post Arguments: - `post_id`: The integer ID of the post you wish to delete. """ url = 'http://www.tumblr.com/api/delete' query = {'email':self._email, 'password':self._password, 'post-id':post_id} self._check_status_code(url, utils.urlencode(query)) def _write(f): - def _wrapper(self, generator='pumblr', group=None, **kw): + def _wrapper(self, generator='pumblr', group=None, date=None, private=0, tags=None, slug=None, **kw): """ Write API. Arguments: - `generator`: A short description of the application - `group`: Post this to a secondary blog on your account + - `date`: (optional) - The post date + - `private`: (optional) 1 or 0. Whether the post is private. + - `tags`: (optional) Comma-separated list of post tags. + - `slug`: (optional) A custom string to appear in the post's URL \n """ url = 'http://www.tumblr.com/api/write' if group is not None: group = '%s.tumblr.com' % group query = dict( email=self._email, password=self._password, generator=generator, - group=group + group=group, + date=date, + private=private, + tags=tags, + slug=slug ) query.update(f(self, **kw)) if not 'type' in query.keys(): raise PumblrError('post type is needed!') self._check_status_code(url, utils.urlencode(query)) _wrapper.__doc__ += f.__doc__ return _wrapper @_auth_check @_write def write_quote(self, quote, source=None): """ Quote Arguments: - `quote`: - `source`:(optional, HTML allowed) """ return dict(type='quote', quote=quote, source=source) @_auth_check @_write def write_regular(self, title, body): """ Regular Arguments: - `title`: - `body`:(HTML allowed) """ return dict(type='regular', title=title, body=body) @_auth_check @_write def write_link(self, url, name=None, description=None): """ Link Arguments: - `url`: - `name`:(optional) - `description`:(optional, HTML allowed) """ return dict(type='link', url=url, name=name, description=description) @_auth_check @_write def write_photo(self, source=None, data=None, caption=None, click_through_url=None): """ Requires either source or data, but not both. If both are specified, source is used. Photo Arguments: - `source`: The URL of the photo to copy. This must be a web-accessible URL, not a local file or intranet location. - `data`: An image file. - `caption`:(optional, HTML allowed) - `click_through_url`: (optional) """ query = { 'type':'photo', 'caption':caption, 'click-through-url':click_through_url } if source is not None: query['source'] = source elif data is not None: query['data'] = data else: raise PumblrError('write photo requires either source or data') return query @_auth_check @_write def write_conversation(self, conversation, title=None): """ Conversation Arguments: - `conversation`: - `title`:(optional) """ return dict( type='conversation', conversation=conversation, title=title ) @_auth_check @_write def write_audio(self, data='', externally_hosted_url=None, caption=None): """ Arguments: - `data`: An audio file. Must be MP3 or AIFF format. - `externally_hosted_url`: (optional, replaces data) - `caption`: (optional, HTML allowed) """ query = dict(type='audio', caption=caption) if externally_hosted_url is not None: query['externally-hosted-url'] = externally_hosted_url else: query['data'] = data return query @_auth_check @_write def write_video(self, embed, caption): """ Arguments: - `embed`: Either the complete HTML code to embed the video, or the URL of a YouTube video page. - `caption`: (optional, HTML allowed) """ return dict( type='video', embed=embed, caption=caption )
seikichi/pumblr
6be06b18c29df21bc3ca3d5d87427b6f0e002c49
modify classifiers in setup.py
diff --git a/setup.py b/setup.py index 004c184..3559ff9 100644 --- a/setup.py +++ b/setup.py @@ -1,26 +1,31 @@ from setuptools import setup, find_packages import sys, os version = '0.1.0' setup(name='pumblr', version=version, description="A python library for The Tumblr API.", long_description="""\ """, - classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python', + ], keywords='tumblr', author='seikichi', author_email='[email protected]', url='http://d.hatena.ne.jp/se-kichi', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ 'simplejson' ], entry_points=""" # -*- Entry points: -*- """, )
seikichi/pumblr
88c8b297f9d7180c83119e771127d467c1af6014
modify install_requires in setup.py (add 'simplejson')
diff --git a/setup.py b/setup.py index 4e096a0..004c184 100644 --- a/setup.py +++ b/setup.py @@ -1,26 +1,26 @@ from setuptools import setup, find_packages import sys, os version = '0.1.0' setup(name='pumblr', version=version, description="A python library for The Tumblr API.", long_description="""\ """, classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers keywords='tumblr', author='seikichi', author_email='[email protected]', url='http://d.hatena.ne.jp/se-kichi', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ - # -*- Extra requirements: -*- + 'simplejson' ], entry_points=""" # -*- Entry points: -*- """, )
seikichi/pumblr
4987842e35215836e7f0d5440a296c24dbd2aeaa
apiにあたえるメールアドレスとパスを変更->認証失敗の場合でも_authenticatedがTrueのままになっていたのを修正
diff --git a/pumblr/api.py b/pumblr/api.py index 4e76ef5..e9ec7ee 100755 --- a/pumblr/api.py +++ b/pumblr/api.py @@ -1,306 +1,307 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import utils import urllib2 import functools json = utils.import_json() from models import ApiRead from errors import PumblrError, PumblrAuthError, PumblrRequestError class API(object): """Tumblr API""" def __init__(self, email=None, password=None): self._authenticated = False if email is not None and password is not None: self.auth(email, password) def _check_we_ll_be_back(self, text): # ;-p if text.startswith('<!DOCTYPE html PUBLIC'): #TODO: not cool... raise PumblrError('We\'ll be back shortly!') def _auth_check(func): """check authenticate""" @functools.wraps(func) def wrapper(self, *args, **kw): if not self._authenticated: raise PumblrError("You are not authenticated yet.") return func(self, *args, **kw) return wrapper def _check_status_code(self, url, data): """POST to url(with data) and check HTTP status code""" try: req = urllib2.urlopen(url, data) return req.read() except urllib2.HTTPError, e: if e.code == 200 or e.code == 201: return # OK if e.code == 404: raise PumblrError('incorrect reblog-key') if e.code == 403: raise PumblrAuthError(str(e)) if e.code == 400: raise PumblrRequestError(str(e)) except Exception, e: raise PumblrError(str(e)) raise PumblrError('') def _read_json_data(self, url, data=None): """open url and return json instance""" text = urllib2.urlopen(url, data).read() self._check_we_ll_be_back(text) return json.loads(utils.extract_dict(text)) def auth(self, email, password): """validate credentials""" self._email = email self._password = password + self._authenticated = False url = 'http://www.tumblr.com/api/authenticate' query = dict( email=self._email, password=self._password, ) text = self._check_status_code(url, utils.urlencode(query)) self._check_we_ll_be_back(text) self._authenticated = True @_auth_check def dashboard(self, start=0, num=20, type=None, likes=0): """ Dashboard reading. Arguments: - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `likes`: (optional) 1 or 0, default 0. If 1, liked posts will have the liked="true" attribute. """ url = 'http://www.tumblr.com/api/dashboard/json' query = dict( email=self._email, password=self._password, start=start, num=num, likes=likes, type=type ) return ApiRead.parse(self._read_json_data(url, utils.urlencode(query))) def read(self, name, start=0, num=20, type=None, id=None, search=None, tagged=None): """ Reading Tumblr data. Arguments: - `name`: username - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: (optional) The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `id`: A specific post ID to return. Use instead of start, num, or type. - `search`: Search for posts with this query. - `tagged`: Return posts with this tag in reverse-chronological order (newest first). """ if id is not None: query = dict(id=id) else: query = dict( start=start, num=num, type=type, search=search, tagged=tagged ) url = "http://%s.tumblr.com/api/read/json?%s" % (name, utils.urlencode(query)) return ApiRead.parse(self._read_json_data(url)) def like(self, post_id, reblog_key): """ Liking post. Arguments: - `post_id`: The numeric post ID to like. - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=True) def unlike(self, post_id, reblog_key): """ Un-Liking post. Arguments: - `post_id`: The numeric post ID to like. - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=False) @_auth_check def _like_unlike(self, post_id, reblog_key, like): url = 'http://www.tumblr.com/api/%s' % ('like' if like else 'unlike') query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key } self._check_status_code(url, utils.urlencode(query)) @_auth_check def reblog(self, post_id, reblog_key, comment=None, reblog_as=None, group=None): """ Reblogging post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. - `comment`: (optional) Text, HTML, or Markdown string (see format) of the commentary added to the reblog. - `reblog_as`: (optional) Reblog as a different format from the original post. - `group`: (optional) Post this to a secondary blog on your account. """ if group is not None: group = '%s.tumblr.com' % group url = 'http://www.tumblr.com/api/reblog' query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key, 'group':group, 'comment':comment, 'as':reblog_as, } self._check_status_code(url, utils.urlencode(query)) @_auth_check def delete(self, post_id): """ Deleting post Arguments: - `post_id`: The integer ID of the post you wish to delete. """ url = 'http://www.tumblr.com/api/delete' query = {'email':self._email, 'password':self._password, 'post-id':post_id} self._check_status_code(url, utils.urlencode(query)) def _write(f): def _wrapper(self, generator='pumblr', group=None, **kw): """ Write API. Arguments: - `generator`: A short description of the application - `group`: Post this to a secondary blog on your account \n """ url = 'http://www.tumblr.com/api/write' if group is not None: group = '%s.tumblr.com' % group query = dict( email=self._email, password=self._password, generator=generator, group=group ) query.update(f(self, **kw)) if not 'type' in query.keys(): raise PumblrError('post type is needed!') self._check_status_code(url, utils.urlencode(query)) _wrapper.__doc__ += f.__doc__ return _wrapper @_auth_check @_write def write_quote(self, quote, source=None): """ Quote Arguments: - `quote`: - `source`:(optional, HTML allowed) """ return dict(type='quote', quote=quote, source=source) @_auth_check @_write def write_regular(self, title, body): """ Regular Arguments: - `title`: - `body`:(HTML allowed) """ return dict(type='regular', title=title, body=body) @_auth_check @_write def write_link(self, url, name=None, description=None): """ Link Arguments: - `url`: - `name`:(optional) - `description`:(optional, HTML allowed) """ return dict(type='link', url=url, name=name, description=description) @_auth_check @_write def write_photo(self, source=None, data=None, caption=None, click_through_url=None): """ Requires either source or data, but not both. If both are specified, source is used. Photo Arguments: - `source`: The URL of the photo to copy. This must be a web-accessible URL, not a local file or intranet location. - `data`: An image file. - `caption`:(optional, HTML allowed) - `click_through_url`: (optional) """ query = { 'type':'photo', 'caption':caption, 'click-through-url':click_through_url } if source is not None: query['source'] = source elif data is not None: query['data'] = data else: raise PumblrError('write photo requires either source or data') return query @_auth_check @_write def write_conversation(self, conversation, title=None): """ Conversation Arguments: - `conversation`: - `title`:(optional) """ return dict( type='conversation', conversation=conversation, title=title ) @_auth_check @_write def write_audio(self, data='', externally_hosted_url=None, caption=None): """ Arguments: - `data`: An audio file. Must be MP3 or AIFF format. - `externally_hosted_url`: (optional, replaces data) - `caption`: (optional, HTML allowed) """ query = dict(type='audio', caption=caption) if externally_hosted_url is not None: query['externally-hosted-url'] = externally_hosted_url else: query['data'] = data return query @_auth_check @_write def write_video(self, embed, caption): """ Arguments: - `embed`: Either the complete HTML code to embed the video, or the URL of a YouTube video page. - `caption`: (optional, HTML allowed) """ return dict( type='video', embed=embed, caption=caption )
seikichi/pumblr
4268e89a2a599ee1d66ac9a977206d341e187dc6
write docstrings of API class method
diff --git a/pumblr/api.py b/pumblr/api.py index fa776ed..4e76ef5 100755 --- a/pumblr/api.py +++ b/pumblr/api.py @@ -1,296 +1,306 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import utils import urllib2 import functools json = utils.import_json() from models import ApiRead from errors import PumblrError, PumblrAuthError, PumblrRequestError class API(object): """Tumblr API""" def __init__(self, email=None, password=None): self._authenticated = False if email is not None and password is not None: self.auth(email, password) def _check_we_ll_be_back(self, text): # ;-p - if text.startswith('<!DOCTYPE html PUBLIC'): #TODO: これ微妙すぎるだろ + if text.startswith('<!DOCTYPE html PUBLIC'): #TODO: not cool... raise PumblrError('We\'ll be back shortly!') def _auth_check(func): """check authenticate""" @functools.wraps(func) def wrapper(self, *args, **kw): if not self._authenticated: raise PumblrError("You are not authenticated yet.") return func(self, *args, **kw) return wrapper def _check_status_code(self, url, data): """POST to url(with data) and check HTTP status code""" try: req = urllib2.urlopen(url, data) return req.read() except urllib2.HTTPError, e: if e.code == 200 or e.code == 201: return # OK if e.code == 404: raise PumblrError('incorrect reblog-key') if e.code == 403: raise PumblrAuthError(str(e)) if e.code == 400: raise PumblrRequestError(str(e)) except Exception, e: raise PumblrError(str(e)) raise PumblrError('') def _read_json_data(self, url, data=None): - """open url and return json instance""" + """open url and return json instance""" text = urllib2.urlopen(url, data).read() self._check_we_ll_be_back(text) return json.loads(utils.extract_dict(text)) def auth(self, email, password): """validate credentials""" self._email = email self._password = password url = 'http://www.tumblr.com/api/authenticate' query = dict( email=self._email, password=self._password, ) text = self._check_status_code(url, utils.urlencode(query)) self._check_we_ll_be_back(text) self._authenticated = True @_auth_check def dashboard(self, start=0, num=20, type=None, likes=0): """ Dashboard reading. Arguments: - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. + - `likes`: (optional) 1 or 0, default 0. If 1, liked posts will have the liked="true" attribute. """ url = 'http://www.tumblr.com/api/dashboard/json' query = dict( email=self._email, password=self._password, start=start, num=num, likes=likes, type=type ) return ApiRead.parse(self._read_json_data(url, utils.urlencode(query))) def read(self, name, start=0, num=20, type=None, id=None, search=None, tagged=None): """ Reading Tumblr data. Arguments: - `name`: username - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. + - `type`: (optional) The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `id`: A specific post ID to return. Use instead of start, num, or type. - `search`: Search for posts with this query. - `tagged`: Return posts with this tag in reverse-chronological order (newest first). """ if id is not None: query = dict(id=id) else: query = dict( start=start, num=num, type=type, search=search, tagged=tagged ) url = "http://%s.tumblr.com/api/read/json?%s" % (name, utils.urlencode(query)) return ApiRead.parse(self._read_json_data(url)) def like(self, post_id, reblog_key): """ Liking post. Arguments: - - `post_id`: The integer ID of the post to reblog. - - `reblog_key`: The corresponding reblog_key value from the post's read data. + - `post_id`: The numeric post ID to like. + - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=True) def unlike(self, post_id, reblog_key): """ Un-Liking post. Arguments: - - `post_id`: The integer ID of the post to reblog. - - `reblog_key`: The corresponding reblog_key value from the post's read data. + - `post_id`: The numeric post ID to like. + - `reblog_key`: he reblog-key value for the specified post from read or dashboard method. """ self._like_unlike(post_id, reblog_key, like=False) @_auth_check def _like_unlike(self, post_id, reblog_key, like): url = 'http://www.tumblr.com/api/%s' % ('like' if like else 'unlike') query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key } self._check_status_code(url, utils.urlencode(query)) @_auth_check def reblog(self, post_id, reblog_key, comment=None, reblog_as=None, group=None): """ Reblogging post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. - - `comment`: Text, HTML, or Markdown string (see format) of the commentary added to the reblog. - - `reblog_as`: Reblog as a different format from the original post. - - `group`: Post this to a secondary blog on your account. + - `comment`: (optional) Text, HTML, or Markdown string (see format) of the commentary added to the reblog. + - `reblog_as`: (optional) Reblog as a different format from the original post. + - `group`: (optional) Post this to a secondary blog on your account. """ if group is not None: group = '%s.tumblr.com' % group url = 'http://www.tumblr.com/api/reblog' query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key, 'group':group, 'comment':comment, 'as':reblog_as, } self._check_status_code(url, utils.urlencode(query)) @_auth_check def delete(self, post_id): """ Deleting post - `post_id` - The integer ID of the post you wish to delete. + Arguments: + - `post_id`: The integer ID of the post you wish to delete. """ url = 'http://www.tumblr.com/api/delete' query = {'email':self._email, 'password':self._password, 'post-id':post_id} self._check_status_code(url, utils.urlencode(query)) def _write(f): def _wrapper(self, generator='pumblr', group=None, **kw): """ Write API. Arguments: - `generator`: A short description of the application - `group`: Post this to a secondary blog on your account \n """ url = 'http://www.tumblr.com/api/write' if group is not None: group = '%s.tumblr.com' % group query = dict( email=self._email, password=self._password, generator=generator, group=group ) query.update(f(self, **kw)) if not 'type' in query.keys(): raise PumblrError('post type is needed!') self._check_status_code(url, utils.urlencode(query)) _wrapper.__doc__ += f.__doc__ return _wrapper @_auth_check @_write def write_quote(self, quote, source=None): """ Quote Arguments: - `quote`: - - `source`: + - `source`:(optional, HTML allowed) """ return dict(type='quote', quote=quote, source=source) @_auth_check @_write def write_regular(self, title, body): """ Regular Arguments: - `title`: - - `body`: + - `body`:(HTML allowed) """ return dict(type='regular', title=title, body=body) @_auth_check @_write def write_link(self, url, name=None, description=None): """ Link Arguments: - - `name`: - `url`: - - `description` + - `name`:(optional) + - `description`:(optional, HTML allowed) """ return dict(type='link', url=url, name=name, description=description) @_auth_check @_write - def write_photo(self, source, data, caption=None, click_through_url=None): + def write_photo(self, source=None, data=None, caption=None, click_through_url=None): """ + Requires either source or data, but not both. If both are specified, source is used. Photo Arguments: - - `source`: - - `data`: - - `caption` - - `click_through_url` + - `source`: The URL of the photo to copy. This must be a web-accessible URL, not a local file or intranet location. + - `data`: An image file. + - `caption`:(optional, HTML allowed) + - `click_through_url`: (optional) """ - return { + query = { 'type':'photo', - 'source':source, - 'data':data, 'caption':caption, 'click-through-url':click_through_url } + if source is not None: + query['source'] = source + elif data is not None: + query['data'] = data + else: + raise PumblrError('write photo requires either source or data') + + return query + @_auth_check @_write def write_conversation(self, conversation, title=None): """ Conversation Arguments: - `conversation`: - - `title`: + - `title`:(optional) """ return dict( type='conversation', conversation=conversation, title=title ) @_auth_check @_write def write_audio(self, data='', externally_hosted_url=None, caption=None): """ Arguments: - - `data`: - - `externally_hosted_url`: - - `caption`: + - `data`: An audio file. Must be MP3 or AIFF format. + - `externally_hosted_url`: (optional, replaces data) + - `caption`: (optional, HTML allowed) """ query = dict(type='audio', caption=caption) if externally_hosted_url is not None: query['externally-hosted-url'] = externally_hosted_url else: query['data'] = data return query @_auth_check @_write def write_video(self, embed, caption): """ Arguments: - - `embed`: - - `caption`: + - `embed`: Either the complete HTML code to embed the video, or the URL of a YouTube video page. + - `caption`: (optional, HTML allowed) """ return dict( type='video', embed=embed, caption=caption )
seikichi/pumblr
8fb5a126e36d48f4c2fde5ce09066f5f4b0b03db
conversation, audio, videoをwriteするメソッド追加
diff --git a/pumblr/api.py b/pumblr/api.py index c81ad2e..fa776ed 100755 --- a/pumblr/api.py +++ b/pumblr/api.py @@ -1,242 +1,296 @@ #!/usr/bin/python # -*- coding: utf-8 -*- import utils import urllib2 import functools json = utils.import_json() from models import ApiRead from errors import PumblrError, PumblrAuthError, PumblrRequestError class API(object): """Tumblr API""" def __init__(self, email=None, password=None): self._authenticated = False if email is not None and password is not None: self.auth(email, password) def _check_we_ll_be_back(self, text): # ;-p if text.startswith('<!DOCTYPE html PUBLIC'): #TODO: これ微妙すぎるだろ raise PumblrError('We\'ll be back shortly!') def _auth_check(func): """check authenticate""" @functools.wraps(func) def wrapper(self, *args, **kw): if not self._authenticated: raise PumblrError("You are not authenticated yet.") return func(self, *args, **kw) return wrapper def _check_status_code(self, url, data): """POST to url(with data) and check HTTP status code""" try: req = urllib2.urlopen(url, data) return req.read() except urllib2.HTTPError, e: if e.code == 200 or e.code == 201: return # OK if e.code == 404: raise PumblrError('incorrect reblog-key') if e.code == 403: raise PumblrAuthError(str(e)) if e.code == 400: raise PumblrRequestError(str(e)) except Exception, e: raise PumblrError(str(e)) raise PumblrError('') def _read_json_data(self, url, data=None): """open url and return json instance""" text = urllib2.urlopen(url, data).read() self._check_we_ll_be_back(text) return json.loads(utils.extract_dict(text)) def auth(self, email, password): """validate credentials""" self._email = email self._password = password url = 'http://www.tumblr.com/api/authenticate' query = dict( email=self._email, password=self._password, ) text = self._check_status_code(url, utils.urlencode(query)) self._check_we_ll_be_back(text) self._authenticated = True @_auth_check def dashboard(self, start=0, num=20, type=None, likes=0): """ Dashboard reading. Arguments: - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. """ url = 'http://www.tumblr.com/api/dashboard/json' query = dict( email=self._email, password=self._password, start=start, num=num, likes=likes, type=type ) return ApiRead.parse(self._read_json_data(url, utils.urlencode(query))) def read(self, name, start=0, num=20, type=None, id=None, search=None, tagged=None): """ Reading Tumblr data. Arguments: - `name`: username - `start`: The post offset to start from. The default is 0. - `num`: The number of posts to return. The default is 20, and the maximum is 50. - `type`: The type of posts to return. If unspecified or empty, all types of posts are returned. Must be one of text, quote, photo, link, chat, video, or audio. - `id`: A specific post ID to return. Use instead of start, num, or type. - `search`: Search for posts with this query. - `tagged`: Return posts with this tag in reverse-chronological order (newest first). """ if id is not None: query = dict(id=id) else: query = dict( start=start, num=num, type=type, search=search, tagged=tagged ) url = "http://%s.tumblr.com/api/read/json?%s" % (name, utils.urlencode(query)) return ApiRead.parse(self._read_json_data(url)) def like(self, post_id, reblog_key): """ Liking post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. """ self._like_unlike(post_id, reblog_key, like=True) def unlike(self, post_id, reblog_key): """ Un-Liking post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. """ self._like_unlike(post_id, reblog_key, like=False) @_auth_check def _like_unlike(self, post_id, reblog_key, like): url = 'http://www.tumblr.com/api/%s' % ('like' if like else 'unlike') query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key } self._check_status_code(url, utils.urlencode(query)) @_auth_check def reblog(self, post_id, reblog_key, comment=None, reblog_as=None, group=None): """ Reblogging post. Arguments: - `post_id`: The integer ID of the post to reblog. - `reblog_key`: The corresponding reblog_key value from the post's read data. - `comment`: Text, HTML, or Markdown string (see format) of the commentary added to the reblog. - `reblog_as`: Reblog as a different format from the original post. - `group`: Post this to a secondary blog on your account. """ if group is not None: group = '%s.tumblr.com' % group url = 'http://www.tumblr.com/api/reblog' query = { 'email':self._email, 'password':self._password, 'post-id':post_id, 'reblog-key':reblog_key, 'group':group, 'comment':comment, 'as':reblog_as, } self._check_status_code(url, utils.urlencode(query)) + @_auth_check + def delete(self, post_id): + """ + Deleting post + `post_id` - The integer ID of the post you wish to delete. + """ + url = 'http://www.tumblr.com/api/delete' + query = {'email':self._email, 'password':self._password, 'post-id':post_id} + self._check_status_code(url, utils.urlencode(query)) + def _write(f): def _wrapper(self, generator='pumblr', group=None, **kw): """ Write API. Arguments: - `generator`: A short description of the application - `group`: Post this to a secondary blog on your account \n """ url = 'http://www.tumblr.com/api/write' if group is not None: group = '%s.tumblr.com' % group query = dict( email=self._email, password=self._password, generator=generator, group=group ) query.update(f(self, **kw)) if not 'type' in query.keys(): raise PumblrError('post type is needed!') self._check_status_code(url, utils.urlencode(query)) _wrapper.__doc__ += f.__doc__ return _wrapper - @_write @_auth_check + @_write def write_quote(self, quote, source=None): """ Quote Arguments: - `quote`: - `source`: """ return dict(type='quote', quote=quote, source=source) - @_write @_auth_check + @_write def write_regular(self, title, body): """ Regular Arguments: - `title`: - `body`: """ return dict(type='regular', title=title, body=body) - @_write @_auth_check + @_write def write_link(self, url, name=None, description=None): """ Link Arguments: - `name`: - `url`: - `description` """ return dict(type='link', url=url, name=name, description=description) - @_write @_auth_check + @_write def write_photo(self, source, data, caption=None, click_through_url=None): """ Photo Arguments: - `source`: - `data`: - `caption` - `click_through_url` """ return { 'type':'photo', 'source':source, 'data':data, 'caption':caption, 'click-through-url':click_through_url } + + @_auth_check + @_write + def write_conversation(self, conversation, title=None): + """ + Conversation Arguments: + - `conversation`: + - `title`: + """ + return dict( + type='conversation', + conversation=conversation, + title=title + ) + + @_auth_check + @_write + def write_audio(self, data='', externally_hosted_url=None, caption=None): + """ + Arguments: + - `data`: + - `externally_hosted_url`: + - `caption`: + """ + query = dict(type='audio', caption=caption) + if externally_hosted_url is not None: + query['externally-hosted-url'] = externally_hosted_url + else: + query['data'] = data + return query + + @_auth_check + @_write + def write_video(self, embed, caption): + """ + Arguments: + - `embed`: + - `caption`: + """ + return dict( + type='video', + embed=embed, + caption=caption + ) diff --git a/test_pumblr.py b/test_pumblr.py index 1380e14..ac184f5 100755 --- a/test_pumblr.py +++ b/test_pumblr.py @@ -1,119 +1,137 @@ #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import with_statement import os import urllib2 from pumblr.api import * from pumblr.errors import * from pumblr.models import * from pumblr.utils import * from nose.tools import * json = import_json() def read_data(filename): """return the data of testdata/${filename}""" filename = os.path.join(os.path.dirname(__file__), 'testdata', filename) with open(filename) as f: return f.read() def test_models(): """test for pumblr/models.py""" data = json.loads(extract_dict(read_data('read.json'))) api_read = ApiRead.parse(data) assert_equal(api_read.tumblelog.description, u'わしの取得単位は108まであるぞ') class StubURLOpen(object): """Stub for urlopen""" def __init__(self, *args, **kw): """don't care""" self._error = False def set_data(self, filename): class _Ret(object): def __init__(self, data): self._data = data def read(self, *args, **kw): return self._data self._ret = _Ret(read_data(filename)) def set_error_code(self, code): self._error = True self._code = code def __call__(self, *args, **kw): if self._error: raise urllib2.HTTPError('', self._code, '', None, None) return self._ret def patch_urllib2(): urllib2._urlopen = urllib2.urlopen urllib2.urlopen = StubURLOpen() def unpatch_urllib2(): urllib2.urlopen = urllib2._urlopen delattr(urllib2, '_urlopen') @with_setup(patch_urllib2, unpatch_urllib2) def test_api_read(): """test for pumblr/api.py""" api = API() urllib2.urlopen.set_data('read.json') # fake api_read = api.read('seikichi') assert_equal(api_read.tumblelog.description, u'わしの取得単位は108まであるぞ') urllib2.urlopen.set_data('dashboard.json') api.auth(email='seikichi@localhost', password='password') # ;-p dashboard = api.dashboard() assert_equal(dashboard.posts[0].id, 1104344180) urllib2.urlopen.set_data('error.xhtml') assert_raises(PumblrError, api.dashboard) @with_setup(patch_urllib2, unpatch_urllib2) def test_api_auth(): api = API() assert_raises(PumblrError, api.dashboard) assert_raises(PumblrError, api.like, 0, 0) assert_raises(PumblrError, api.unlike, 0, 0) assert_raises(PumblrError, api.reblog, 0, 0) + assert_raises(PumblrError, api.write_quote, {'quote':'hoge'}) + assert_raises(PumblrError, api.write_regular, {'title':'hoge', 'body':'fuga'}) + assert_raises(PumblrError, api.write_link, {'url':'http://localhost', 'name':'見ろ人がゴミのようだ', 'description':'うおー'}) @with_setup(patch_urllib2, unpatch_urllib2) def test_error_code(): api = API() urllib2.urlopen.set_data('dashboard.json') # dummy api.auth(email='seikichi@localhost', password='password') # ;-p urllib2.urlopen.set_error_code(403) assert_raises(PumblrAuthError, api.like, 0, 0) urllib2.urlopen.set_error_code(400) assert_raises(PumblrRequestError, api.like, 0, 0) urllib2.urlopen.set_error_code(403) assert_raises(PumblrAuthError, api.unlike, 0, 0) urllib2.urlopen.set_error_code(400) assert_raises(PumblrRequestError, api.unlike, 0, 0) urllib2.urlopen.set_error_code(404) assert_raises(PumblrError, api.reblog, 0, 0) +@with_setup(patch_urllib2, unpatch_urllib2) +def test_api_delete(): + api = API() + urllib2.urlopen.set_data('dashboard.json') # dummy + api.auth(email='seikichi@localhost', password='password') # ;-p + urllib2.urlopen.set_error_code(201) + api.delete(123456789) + + @with_setup(patch_urllib2, unpatch_urllib2) def test_api_write(): api = API() urllib2.urlopen.set_data('dashboard.json') # dummy api.auth(email='seikichi@localhost', password='password') # ;-p urllib2.urlopen.set_error_code(201) api.write_quote(quote='ほげふがー', source='pyo------') api.write_regular(title='みょーーん', body='はいはいワロスワロス') + api.write_quote(quote='hoge') + api.write_regular(title='hoge', body='fuga') + api.write_link(url='http://localhost', name='見ろ人がゴミのようだ', description='うおー') + api.write_conversation(conversation='うおー', title='書くの飽きてきた') + api.write_audio(externally_hosted_url='書く意味あるのかなーと思わんでもない', caption='壁殴り代行始めました') + api.write_video(embed='<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/Pqisib2bAb8?fs=1&amp;hl=ja_JP"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Pqisib2bAb8?fs=1&amp;hl=ja_JP" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>', caption='あらぶるてんしんらんまんの何とか')