Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Opera + Firefox browser Shortcut for searching CPAN & Perldoc

by monkfan (Curate)
on Apr 13, 2005 at 03:01 UTC ( [id://447243]=CUFP: print w/replies, xml ) Need Help??

Here are the snippets that allow you to do custom searching by keyword in Opera and Firefox for CPAN repository.

If you are using Opera browser, with this snippet you can directly search CPAN by typing this command under address bar:

cpan Module::Name
or
cpan Anything

Store this snippet under file: ~/.opera/search.ini

For Firefox, please follow subsequent instruction:
Opera
[Search Engine 41] Name=&cpan URL=http://search.cpan.org/search?m=all&q=%s&s=1&n=20 Query= Key=cpan Is post=0 Has endseparator=0 Encoding=utf-8 Search Type=0 Verbtext=17063 Position=-1 Nameid=0
Firefox
* Bookmark: http://search.cpan.org/search?m=all&q=%s&s=1&n=20 where the %s will be replaced by the query string * Give the bookmark the keyword: cpan * By typing: cpan Module::Name -in the addressbar will get the module

Replies are listed 'Best First'.
Re: Opera + Firefox browser Shortcut for searching CPAN
by dbwiz (Curate) on Apr 13, 2005 at 08:24 UTC

    An useful variation would be a bookmark with keyword "perldoc":

    http://search.cpan.org/perldoc?%s

    When you type "perldoc Module::Name", it will take you directly to the docs.

    However, you must provide an exact name. No search on partial matches is provided.

    Update Removed a spurious "=" sign from the URL. Thanks ewijava.

      Have you tested it? Accessing perldoc of a module in CPAN is done via authors directory. Hence your solution will fail.

      Alternatively this is the snippet to access perldoc.com website. Applicable for both Opera and Firefox.
      http://www.perldoc.com/cgi-bin/htsearch?words=%s&restrict=perl5.8.4
      Regards,
      Edward
Re: Opera + Firefox browser Shortcut for searching CPAN & Perldoc
by Roy Johnson (Monsignor) on Apr 13, 2005 at 17:48 UTC
    Firefox has a search box separate from (to the right of) the address box, and has a mechanism set up for populating it. CPAN has an entry already, and perldoc does too. They've got them for ebay, pricegrabber, half.com, wikipedia, dictionary.com, ... the list just goes on and on. It seems a little silly to roll your own mechanism for Firefox.

    Caution: Contents may have been coded under pressure.
Re: Opera + Firefox browser Shortcut for searching CPAN
by tlm (Prior) on Apr 13, 2005 at 12:08 UTC

    Here's a couple useful ones for Firefox

    keyword: pdoc location: http://perldoc.perl.org/%s.html example: pdoc perltoot keyword: pfunc location: http://perldoc.perl.org/functions/%s.html example: pfunc chomp
    The choice of keywords is arbitrary; use whatever you like.

    the lowliest monk

Re: Opera + Firefox browser Shortcut for searching CPAN & Perldoc
by bhilton (Initiate) on Apr 14, 2005 at 13:35 UTC
    Maybe it's because I'm on Linux or something, but I can't get the Firefox bookmarks to work as easily as you guys seem to.

    I've added a "cpan" bookmark with the following location:

    http://search.cpan.org/search?mode=all&query=%s
    If I try to search for something with colons (like Text::CSV), I get an alert popup with the following text:

    "The URL is not valid and cannot be loaded."

    I either have to use "keyword:cpan" instead of "cpan" or replace colons with "%3a" in the module name.

      Just browse on over to your site of choice, right click in the search text field and select 'Add a Keyword for this search'. This will do the same with less typing.

      satchm0h...stumbling down the path toward enlightenment
      Try to use the snippet I provide *verbatim*, do not alter it. Even under Linux, you can get the result:
      http://search.cpan.org/search?m=all&q=Text%3A%3ACSV&s=1&n=20
      Just with command: cpan Text::CSV
      Notice the common pattern between the two URLs.
      Regards,
      Edward
Re: Opera + Firefox browser Shortcut for searching CPAN & Perldoc
by Intrepid (Deacon) on May 15, 2005 at 01:53 UTC

    I think this is a nice tip, even if it is not Perl code ;-). ewijaya wrote:

    Store this snippet under file: ~/.opera/search.ini

    Of course a user of MSWindows (who might well be using Opera) will not have any " ~ " dir. On my MS Windows XP system I empirically determined that this expression gives the location of the file which one wants to insert the Opera "snippet" into:

    perl -MFile::Spec::Functions -le "print catfile( \$ENV{USERPROFILE}=> +q[APPLIC~1]=> q[Opera/Opera7/profile/search.ini] )"
      That script doesn't work for me, however I am using Opera 9.x, not Opera 7. If I remember correctly, the search.ini file can be located in the C:\program files\Opera\

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://447243]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 23:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found