Page 1 of 2

SearchTheWeb

Posted: 17 Nov 2008 22:31
by serendipity
With "SearchTheWeb" script using which one can search the web for:
XYwiki, XY forum, Google, Wikipedia, IMDB, US weather, World weather from within XY.

How it works: Simply unzip the zipfile into scriptsfolder and load from catalog or addressbar using ::load SearchTheWeb;

Download SearchTheWeb.zip:
SearchTheWeb.zip
Updated 19th Nov:
+Changed the script name to a more appropriate SearchTheWeb.xys (SearchSuit was wrong anyway it should have been SearchSuite [Thanks JC!!]).
+ Checks if version is 7.80.0008 or higher
+ Changed minor misquotes as suggested by Don.
Also, If you need any special search to be included let me know. :)


For those who want to see the code before downloading:

Code: Select all

//SearchTheWeb v1

"Search The Web"
   load *;
-
"&1) XYWiki : xywiki"
   sub _assert;
   input $wiki, "Search XYWiki", "udc";
   $wiki=urlencode($wiki,1);
   open "http://88.191.26.34/XYwiki/index.php/Special:Search?search=$wiki&go=Go"

"&2) XY Forum : xyforum"
   sub _assert;
   input $forum, "Search XY Forums", "dual pane";
   $forum=urlencode($forum,1);
   open "http://www.xyplorer.com/xyfc/search.php?keywords=$forum&terms=all&author=&sc=1&sf=all&sk=t&sd=d&sr=posts&st=0&ch=300&t=0&submit=Search"
   
-
"&3) Google : google"
   sub _assert;
   input $google, "Search Google", "XYplorer";
   $google=urlencode($google,1);
   open "http://www.google.com/search?hl=en&q=$google&btnG=Google+Search&aq=f&oq="


"&4) Wikipedia : wikipedia"
   sub _assert;
   input $wikipedia, "Search Wikipedia", "XYplorer";
   $wikipedia=urlencode($wikipedia,1);
   open "http://en.wikipedia.org/wiki/Special:Search?search=$wikipedia&go=Go"

-
"&5) IMDB : imdb"
   sub _assert;
   input $imdb, "Search IMDB", "Quantum of Solace";
   $imdb=urlencode($imdb,1);
   open "http://www.imdb.com/find?s=all&q=$imdb&x=0&y=0"

-
"&6) US Weather : usweather"
   sub _assert;
   input $usweather, "Enter location (Zipcode or City, State)", "10032";
   replace $usweather, $usweather, " ", ",";
   replace $usweather, $usweather, ",,", ",";
   $usweather=urlencode($usweather,1);
   open "http://www.accuweather.com/us-city-list.asp?zipcode=$usweather&submit=GO&u=1&partner=touchthesky"

"&7) World weather : world"
   sub _assert;
   input $weather, "Enter location (City, Country)", "Berlin, Germany";
   replace $weather, $weather, " ", ",";
   replace $weather, $weather, ",,", ",";
   $weather=urlencode($weather,1);
   open "http://www.accuweather.com/world-city-list.asp?loccode=$weather&Submit1=GO%21"

//Assert script: Thanks to Jacky!!
"_assert : _assert"
  $minimum = "7.80.0008"; $compatible = (compare(<xyver>, $minimum, v) == -1) ? 0 : 1; assert ($compatible), "XY too old! Continue at your own risk", 1; status "Something that could fail with versions older than $minimum...";

- 
"Edit script : edit"
   self $ScriptFile, file;
   Open $ScriptFile,w;   
-
"Cancel"
PS: I used Opera's edit search feature (which is most underrated IMO) to get those search codes. :)

Re: Search suit

Posted: 18 Nov 2008 15:18
by eurytos
Wow!!

Very nice Serendipity!


It works great, thanks so much for posting this.


-Steve

Re: Search suit

Posted: 18 Nov 2008 16:29
by graham
Brilliant - a simple application only possible with XY

Re: SearchTheWeb

Posted: 18 Nov 2008 18:43
by serendipity
Thanks!! Glad you like it.
PS: Updated few things.

Re: SearchTheWeb

Posted: 18 Nov 2008 20:08
by admin
serendipity wrote:Thanks!! Glad you like it.
PS: Updated few things.
Yes, I like it too.

However, you need to polish your syntax (the quoting) a bit. :P

Before:

Code: Select all

"&1) XYWiki : xywiki"
   sub _assert;
   input $wiki, "Search XYWiki", udc;
   $wiki=urlencode("$wiki",1);
   open "http://88.191.26.34/XYwiki/index.php/Special:Search?search="."$wiki"."&go=Go"
After:

Code: Select all

"&1) XYWiki : xywiki"
   sub _assert;
   input $wiki, "Search XYWiki", "udc";
   $wiki=urlencode($wiki,1);
   open "http://88.191.26.34/XYwiki/index.php/Special:Search?search=$wiki&go=Go"

Re: SearchTheWeb

Posted: 20 Nov 2008 03:04
by serendipity
SearchTheWeb_v2:
Same searches as before, but this one remembers your last entry. So there will be a .ini file created in the XY's script folder.
SearchTheWeb_v2.zip

Re: SearchTheWeb

Posted: 20 Nov 2008 07:57
by admin
serendipity wrote:SearchTheWeb_v2:
Same searches as before, but this one remembers your last entry. So there will be a .ini file created in the XY's script folder.
SearchTheWeb_v2.zip
Great stuff! :D

Little syntax remark (quoting again):
This:
status "SearchTheWeb: Search "$wiki" in XYWiki", 006400;
should be this:
status "SearchTheWeb: Search ""$wiki"" in XYWiki", 006400;
or this:
status "SearchTheWeb: Search '$wiki' in XYWiki", 006400;
or this:
status "SearchTheWeb: Search " . quote($wiki) . " in XYWiki", 006400;

Re: SearchTheWeb

Posted: 20 Nov 2008 16:38
by serendipity
admin wrote:
serendipity wrote:SearchTheWeb_v2:
Same searches as before, but this one remembers your last entry. So there will be a .ini file created in the XY's script folder.
SearchTheWeb_v2.zip
Great stuff! :D

Little syntax remark (quoting again):
This:
status "SearchTheWeb: Search "$wiki" in XYWiki", 006400;
should be this:
status "SearchTheWeb: Search ""$wiki"" in XYWiki", 006400;
or this:
status "SearchTheWeb: Search '$wiki' in XYWiki", 006400;
or this:
status "SearchTheWeb: Search " . quote($wiki) . " in XYWiki", 006400;
Yep, thanks. Changed it.
SearchTheWeb_v2.xys

Re: SearchTheWeb

Posted: 23 Nov 2008 22:54
by serendipity
Added dictionary and google map.
SearchTheWeb_v2.xys

Re: SearchTheWeb

Posted: 24 Nov 2008 07:52
by admin
serendipity wrote:Added dictionary and google map.
SearchTheWeb_v2.xys
Man, this thing is getting interesting...! :D

Re: SearchTheWeb

Posted: 30 Nov 2008 16:43
by ramza__x
i login, just to say... cool stuff!!

thanks serendipity!

Re: SearchTheWeb

Posted: 30 Nov 2008 22:49
by serendipity
ramza__x wrote:i login, just to say... cool stuff!!

thanks serendipity!
Glad you like it. :)

Re: SearchTheWeb

Posted: 26 Jan 2009 04:02
by serendipity
Here is SearchTheWeb v3, it works the same way as before, but is made in html now and requires v7.90.0029.

Download:
SearchTheWeb_v3.xys

Re: SearchTheWeb

Posted: 26 Jan 2009 09:12
by admin
serendipity wrote:Here is SearchTheWeb v3, it works the same way as before, but is made in html now and requires v7.90.0029.

Download:
SearchTheWeb_v3.xys
Wow, cool!

And it reminds me that I have to add a UFT8decode function... I entered "Köln" in the wheather field... :roll:

Re: SearchTheWeb

Posted: 26 Jan 2009 16:38
by serendipity
admin wrote:
serendipity wrote:Here is SearchTheWeb v3, it works the same way as before, but is made in html now and requires v7.90.0029.

Download:
SearchTheWeb_v3.xys
Wow, cool!

And it reminds me that I have to add a UFT8decode function... I entered "Köln" in the wheather field... :roll:
Thanks for adding UT8decode. Try the newer version now:
SearchTheWeb_v3.xys
PS: requires 7.90.0075.