WebSearch 0.5

Browsers, email, chat, etc.
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

WebSearch 0.5

#1 Post by Argolance »

Bonjour,
Everything is in the title and images...

0.5 version (20181227):
- Browser selector in Preferences (optionally displayed in the WebSearch bar)
- Check Internet connection using the option "no-check-certificate" (MochiMoppel)
- /root/Choices/URI/https link to defaultbrowser automatically created if not existing (MochiMoppel)
- Engines info files - en, fr - new formatting ("|" instead of "tabs" > fredx181)
- Engine scripts modified to allow selected browser to work instead of xdg-open
- Spanish translation (nilsonmorales - 0.4)
- French translation

0.4 version (20181219):
- WebSearch bar/icons size (mfb)
- Display WebSearch as desktop application (needs gtkdialog-desklet)
- Engines info files - en, fr - (English file created by musher0)
- Run WebSearch at startup
- Now check for Internet connection when clicking the "Find" button to avoid the warning message if WebSearch configured to be run at startup and connection not yet active
- Changed /root to $HOME (vovchik)
- French translation updated
- gtktc file renamed as gtkrc_ws to avoid overwritting of gtkrc 2Pc file (for ToOpPy users)

0.3 version (20181217):
- JWM options excluded from Preferences when JWM is not active
- Blended background or foreground JWM colors taken into account and selectable separately (:wink: radky)
- http://google.com changed to http://duckduckgo.com (:wink: musher0)
- French translation

0.2 version (20181215):
- Engines are stored in the application "engines" directory and have each their own configuration file. They can now be dynamically listed, managed and user can create its own configuration file if an engine is missing.
36 search engines available (dynamically):
  • - 500px
    - Ask
    - Bandcamp
    - Bing
    - CNN
    - Cplusplus
    - Crunchyroll
    - Docker Hub
    - Dribbble
    - DuckDuckGo
    - eBay
    - Ecosia
    - Facebook
    - Gibiru
    - Giphy
    - Google
    - Internet Archive
    - Lilo
    - Netflix
    - NhacCuaTui
    - Pinterest
    - Quora
    - Qwant
    - Rotten Tomatoes
    - Slideshare
    - SoundCloud
    - Stack Overflow
    - Swisscows
    - The Register
    - Twitter
    - Vimeo
    - Wikipedia
    - WolframAlpha
    - Yahoo
    - Yandex
    - YouTube

0.1 version (20181212):
More than 20 search engines available (statically):
  • - Ask
    - Bing
    - DuckDuckGo
    - eBay
    - Ecosia
    - Facebook
    - Gibiru
    - Giphy (Animated GIFs)
    - Google
    - Internet Archive (Digital library)
    - Lilo
    - Pinterest
    - Quora
    - Qwant
    - Slideshare (Presentations)
    - Swisscows
    - Vimeo
    - Wikipedia
    - Yahoo
    - Yandex
    - YouTube
Cheers!
Attachments
181228_122831_775x60_easyshot.jpg
(63.66 KiB) Downloaded 229 times
181227_122120_530x573_easyshot.jpg
(47.09 KiB) Downloaded 273 times
websearch-0.5_all.pet
(27.69 KiB) Downloaded 179 times
gtk2desklet-3.1.pet
Additional program to display WebSearch as desktop application
(32.08 KiB) Downloaded 197 times
websearch-0.4_all.pet
(18.11 KiB) Downloaded 185 times
websearch-0.3_all.pet
(15.34 KiB) Downloaded 177 times
websearch-0.2_all.pet
(14.57 KiB) Downloaded 166 times
websearch-0.1_all.pet
(11.55 KiB) Downloaded 210 times
Last edited by Argolance on Thu 10 Jan 2019, 09:07, edited 11 times in total.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#2 Post by smokey01 »

@Argolance, very nice.

I tried it in Fatdog64 and it is missing the green arrow.

I substituted your line (about : 350)

Code: Select all

<pixmap><input file>/usr/share/icons/hicolor/16x16/actions/gtk-go-forward-ltr.png</input></pixmap>
with

Code: Select all

<pixmap stock-icon-size=\"3\"><input file stock=\"gtk-go-forward\"></input></pixmap>
so you don't need to include the arrow icon.

Originally I hadn't installed it, just ran the script so it couldn't find your added icon.

Thanks for this, very handy.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#3 Post by Argolance »

Bonjour,
Originally I hadn't installed it, just ran the script so it couldn't find your added icon.
I would have used the stock icon if I succeeded in giving it the right size. It was indeed to big: so, thanks for the trick!
Thanks for this, very handy.
The pleasure is all mine! :)

Cordialement.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#4 Post by fredx181 »

Thanks, works great !!

Fred

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#5 Post by amigo »

What about Wolfram?

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#6 Post by Argolance »

amigo wrote:What about Wolfram?
  • 1st step:
    Line 110:

    Code: Select all

    #web search
    function FIND[...]
    Copy/past these lines (just after the lines related to Wikipedia):

    Code: Select all

    elif  [ "$ENGINE" = "WolframAlpha" ]; then
    	SEARCHTXT=$(echo "$SEARCHTXT" | sed 's/^/+/;s/ /+/g')
    	xdg-open https://www.wolframalpha.com/input/?i="$SEARCHTXT"
    2nd step:
    Edit /root/.websearch/websearch_engines and add WolframAlpha (case sensitive) to the list, just after Wikipedia (to respect the alphabetical order).
NOTE: please, if you wish some engines to be added to the script, feel free to tell it!

Thanks.
Last edited by Argolance on Sat 15 Dec 2018, 17:41, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

Hi Argo.

Ça marche pas. / It doesn't work.
[~]>whereis websearch
websearch: /usr/bin/websearch /usr/local/websearch /usr/share/applications/websearch.desktop

[~]>websearch

(And the cursor stays there, blinking, forever and ever, amen.)
(Et le curseur reste là, à clignoter, dans les siècles des siècles, amen.)
Is there a remedy?

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#8 Post by fredx181 »

musher0 wrote: Ça marche pas. / It doesn't work.
Could be because you don't have "xdg-open" maybe, check with:

Code: Select all

which xdg-open
It's part of package xdg-ulils.

Fred

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#9 Post by Argolance »

musher0 wrote:Ça marche pas. / It doesn't work.
Ça marche pô? :roll:
Ben mon colon, pour un "vieux de la vieille", tu ne donnes pas beaucoup de grain à moudre, hein!
Quel Puppy,? Que dit la console? Peut-être en effet te manque-t-il xdg-open mais ça m'étonnerait. De mon côté, j'ai testé sur Stretch 7.5, Tahr 6.0.5 et il semble que là en tout cas, tout est OK, mais...
Last edited by Argolance on Fri 14 Dec 2018, 17:21, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post by musher0 »

I have it:

Code: Select all

[~]>which xdg-open
/usr/bin/xdg-open
Edit, 2minutes later:
Actually, it's here:

Code: Select all

[/usr/local/bin]>lg xdg-open
-rwxr-xr-x 1 451 nov 29  2015 xdg-open*
With contents:

Code: Select all

#!/bin/bash
#this script created by Jemimah. see: http://murga-linux.com/puppy/viewtopic.php?t=63400&start=150
#110115 xdg-open used to be a symlink to defaulthandler.

case "$1" in
        '') exit
                ;;
        *://*) exec rox -U "$1"
                ;;
        *@*.*) exec rox -U "mailto:${1}"
                ;;
        *) exec rox "$1"
                ;;
        magnet:*) exec transmission "$1"
                ;;
esac
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#11 Post by Argolance »

@musher0
Nos messages se sont croisés, sans doute n'as-tu pas vu ma réponse/question ci-dessus?
Argolance wrote:Quel Puppy? Que dit la console?

Code: Select all

# websearch
???????
et (par exemple):

Code: Select all

# xdg-open https://www.google.com/search?q=murga+linux+musher0
:wink:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post by musher0 »

Hello Argo.

The console says « rien », it just hangs there.
The Pup is xenialPup-706.

Will try your search about me! :lol: Finding yourself being a long
process...

Edit, a minute later:
I didn't find anything!!! Becôz I have everything google blocked in my
hosts file. :twisted:

Edit, a few hours later:
I found something, however (pls see attached pic) :lol:, with J. Assange's
surfraw. Puppy version is here, on augras' ElkArte Puppy forum, « en bas »

Vu que Monsieur Assange et cie ont déja créé quelque chose, pourquoi
ne pas t'en servir comme base ? / Since Mr. Assange & Co have already
created something, why not use it as a base?

BFN / À+
Attachments
Finding-Tarot_Readings-with-Assange's-surfraw.jpg
(201.13 KiB) Downloaded 564 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#13 Post by Argolance »

Bonjour,
musher0 wrote:The console says « rien », it just hangs there.
The Pup is xenialPup-706.
I tested WebSearch on Slacko 6.3.0 and Xenialpup 7.5. I noticed that it works well on Xenialpup but doesn't on Slacko.
Running in console, I got:

Code: Select all

# websearch
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope"><env:Body xmlns:rox="http://rox.sourceforge.net/SOAP/ROX-Filer"><env:Fault xmlns:rpc="http://www.w3.org/2001/12/soap-rpc" xmlns:env="http://www.w3.org/2001/12/soap-envelope"><faultcode>Failed</faultcode><faultstring>https://www.duckduckgo.com/?q=+Murga+LINUX: no handler for https</faultstring></env:Fault></env:Body></env:Envelope>
This was solved while creating a link to /usr/local/bin/defaultbrowser called "https" in /root/Choices/URI.
You probably encountered the same problem.

:arrow: WebSearch 0.2 is available. Details in the first message of this topic.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#14 Post by musher0 »

Hello, Argolance.

I tested your version 2, from console and by clicking on the
websearch.desktop file, and it still does not work on this Pup. If it's relying
on any jwm structure or element (as you sometimes do), my WM's of
choice at present are either pekwm or echinus. So that could be an
explanation.

I checked:
xenialPup-706 has a https symlink at ROX's URI directory
and
Jemimah's xdg-open script is so general and well done that it can pick
up everything.

Sorry, it's all the time I have for testing at present. Regular life is calling
this Saturday in the form of "shop for winter tires urgently"! :)

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

#15 Post by radky »

Hi Argolance,

Thank you for WebSearch -- very nice!

There is one small problem for JWM themes in which the background or foreground color is defined by blended nomenclature.

For example, WebSearch does not currently parse ACTIVE_BG='#3F3F3F:#000000' in the Aurora theme below:

MENU_BG='#181920'
ACTIVE_BG='#3F3F3F:#000000'
FOREGROUND='#A5A5A5'
PAGER_BG='#353746'
FG_SELECTED='gray65'

One possible solution would be an additional cut command to select the first of the two blended colors (cut -d':' -f1).

---

WebSearch is also quite useful for desktop environments other than JWM. However, in such cases, the 'Sticky, Above and JWM colors' options in Preferences are no longer valid. Would it be helpful to test the current desktop environment and exclude those options in Preferences when JWM is not active?

Again, your contributions to the Puppy community are much appreciated.
[color=blue][b][url=http://www.smokey01.com/radky/PupMates.html]PupMates[/url][/b][/color]

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#16 Post by fredx181 »

Argolance wrote:0.2 version (20181215):
...
36 search engines available
36... Is that all ? :lol: :wink:
Very nice, thanks again !

Fred

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#17 Post by Argolance »

Bonsoir,
@radky
Thank you very much for the report and the wise advice I will (try to) take into account in the next version.

@fredx181
Who can do more can do less! As it is now possible to remove unwanted engines from the list, and even delete them permanently, it seemed to me that it was a good choice! :wink:
Thanks.

Cordialement.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#18 Post by musher0 »

Success !

Hello Argolance.

I got your websearch, v. 2, to run by changing google.com to
duckduckgo.com (at lines 15 & 16)

Code: Select all

#verify first Internet connection
wget --quiet --spider http://duckduckgo.com
I have blocked everything google in my hosts file, that's why your script
hung. I also tried with www.ask.com. But then I get the error message
"not connected, etc.", when in fact I am, connected.

But duckduckgo is quite fine by me as a starting point.

Since I am probably not the only one using the "block google" hosts file
(e.g. you'll see the name of forum member "tallboy" in that "block
google" thread, too), do you think it would be possible for you to check
the return from google.com and if nothing, have duckduckgo as a fallback
position?

Maybe play a bit with wget's exit codes?

TIA.

(Edited, about an hour later)
If I may suggest a couple of things:
To check if the Puppy is online:

Code: Select all

[ "`lsof -i | wc -l`" -gt "1" ] && echo "On line" || echo "Off line" 
To check if google.com is blocked in the user's hosts file

Code: Select all

awk '$1 ~ /127.0.0.1/ && $2 ~ /google.com/ { print "google is blocked" }' /etc/hosts
or

Code: Select all

grep "google.com" /etc/hosts | grep -m 1 "127.0.0.1"
Just a couple of ideas.

BFN.
Attachments
OK-avec-duckduckgo.jpg
(201.8 KiB) Downloaded 328 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#19 Post by musher0 »

Startpage.com also works.

Code: Select all

wget --quiet --spider "https://www.startpage.com"
echo $?
0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#20 Post by Argolance »

Bonjour,
:arrow: WebSearch 0.3 is available. Details in the first message of this topic.
Thanks to radky and musher0 for their suggestions.

Cordialement.

Post Reply