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:

#41 Post by Argolance »

fredx181 wrote:Maybe it's useful somehow, your html output above looks better, btw.
You've got the bottom line, mate! :D
html file may be better when text has icons/pictures, links and so on but in the present case, as we have just simple text, mono font through gtkrc file seems to be the best solution and the more "universal", because this font is in most of the systems.
Thanks.

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

#42 Post by fredx181 »

Argolance wrote:
fredx181 wrote:Maybe it's useful somehow, your html output above looks better, btw.
You've got the bottom line, mate! :D
html file may be better when text has icons/pictures, links and so on but in the present case, as we have just simple text, mono font through gtkrc file seems to be the best solution and the more "universal", because this font is in most of the systems.
Thanks.
Ok, nice !!

As you probably noticed, the whole description is on one line for every engine.
I found that it works ok also if you move part of it to the next line and make the width again 100 (as it was how you did).

Fred
Attachments
2018-12-20-153212_595x56_scrot.png
(15.32 KiB) Downloaded 211 times

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

#43 Post by musher0 »

To make everyone cringe :twisted: , I'll stick with my less verson!!! ;)
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:

#44 Post by Argolance »

fredx181 wrote:I found that it works ok also if you move part of it to the next line and make the width again 100 (as it was how you did).
Yes, and with this solution it is sure that all users will have quite the same perfect display. :wink:
Attachments
181220_232818_706x448_easyshot.jpg
(62.67 KiB) Downloaded 142 times

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

#45 Post by musher0 »

Hello all.

I do not wish to beard anyone, but... /
Je ne souhaite barber personne, mais...

Since no one answered clearly my question about how to make a text
look typographically the same in a GUI and in a CLI, I took the liberty
of changing lines 223-229 of Argolance's websearch v. 4 to line 223.

Argolance suggested an html solution, mostly unavailable in CLI, unless
we use links or lynx.

FredX came close but did not use the same "txt2" example as I did, and
he criticized my line length. There is a good reason I cut the lines
where I did : readability!

FWIW:

Code: Select all

From (lines 223 to 229)
function ENGINES_INFO () {
     if [ -f "$APP_DIR/help_files/websearch_engines_$lng2.txt" ];then
          Xdialog --title "WebSearch - $(gettext 'Engines Info')" --left --no-cancel --textbox "/usr/local/websearch/help_files/websearch_engines_$lng2.txt" 30 100
     else
          Xdialog --title "WebSearch - Engines Info" --left --no-cancel --textbox "/usr/local/websearch/help_files/websearch_engines_en.txt" 30 100
     fi
} ; export -f ENGINES_INFO

To (line 223)
function ENGINES_INFO () { vis6 $APP_DIR/help_files/websearch_engines_${LANG:0:2}.txt2 ; } ; export -f ENGINES_INFO

~~~~~~~~~~~~~~~~~
vis6 is a symlink to 
#!/bin/ash
# visionner-avec-less6.sh (pour CD-qui-joue.sh)
# (c) musher0, 11 févr. 2016
# Pour le script ps-a-forest.sh
####
# On peut charger dans son éditeur de texte un texte affiché par less
# en tapant la touche 'v' : / Typing the 'v' key, you can load in your
# text editor a text displayed by less.
[ `which joe` ] && export EDITOR=/opt/local/bin/joel.sh || export EDITOR=/usr/local/bin/defaulttexteditor
# Also known to work with less: / Fonctionnent bien avec less aussi :
# export EDITOR=/usr/bin/geany # export EDITOR=/usr/bin/teagtk
#
# export LESSEDIT=%E %f # LESSEDIT fonctionne comme-ci comme-ça.
#
# NOTE -- Leafpad doesn't load any text sent by less. /
# Leafpad ne charge aucun texte à partir de less.

# Pour urxvt
G="g 85x24+280+180";TitreFen="`cat /tmp/TitreFen`"
COLR="fg NavajoWhite1 -bg DarkGreen -bd "#DBD37C" -cr gold"
FNT="fn xft:Monaco:pixelsize=13:antialias=true:autohint=true "
TRNSP="tr -sh 50 -tint SaddleBrown";DIVERS="sb +st +tcw -sbt 14 -bc"

# Pour less
[ "${LANG:0:2}" = "fr" ] && INFO="'q' -> quitter; 'g' -> haut; 'G' -> bas; 'd' -> descendre; 'u' -> monter" || INFO=" 'q' -> quit; 'g' -> top; 'G' -> bottom; 'd' -> down; 'u' -> up"
LessParms="R -C -~ -b 2 -J -w -s -x 3 -z 72 -S"

# Affichage
rxvt -title "$TitreFen" -$FNT -$TRNSP +$DIVERS -$COLR -b 19 -$G &>/dev/null -e less -$LessParms -P "     $INFO  " -~ "$1"
As I said, this is not intended as an insult to anyone, it is an "I"
statement. Do with the above as you will, answer or not my original
question. But i am plain tired of researching many of the answers to my
questions myself.

I think I'll officially join StackOverflow or the "Unix and Linux Forums".
It may profit me more. :x

BFN.
Attachments
vis6.jpg
(204.54 KiB) Downloaded 145 times
Last edited by musher0 on Thu 20 Dec 2018, 23:33, edited 1 time in total.
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

#46 Post by fredx181 »

musher0 wrote:To make everyone cringe :twisted: , I'll stick with my less verson!!! ;)
Sometimes it works for people to become a nicer person when you just pretend that you are (instead of doing the opposite). (:?: :idea: :?:)

Fred
Last edited by fredx181 on Thu 20 Dec 2018, 23:36, edited 1 time in total.

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

#47 Post by musher0 »

fredx181 wrote:
musher0 wrote:To make everyone cringe :twisted: , I'll stick with my less verson!!! ;)
Sometimes it works for people to become a nicer person when you just pretend that you are (instead of the opposite). (:?: :idea: :?:)

Fred
Life has taught me that when one is too nice, people walk all over you.
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

#48 Post by fredx181 »

musher0 wrote:
fredx181 wrote:
musher0 wrote:To make everyone cringe :twisted: , I'll stick with my less verson!!! ;)
Sometimes it works for people to become a nicer person when you just pretend that you are (instead of the opposite). (:?: :idea: :?:)

Fred
Life has taught me that when one is too nice, people walk all over you.
Ok, of course that can be, but I really can't see any danger for that in this particular case (subject / thread). Do you ?
Your "cringe" comment comes over as useless and non-constructive to me.

Fred

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

#49 Post by musher0 »

Ok, ok. Let's not quarrel.

A browser is a good solution except there is the risk of accents not displ-
aying as they should in non-English languages. With links, e.g.; palemoon is
ok for this, but I feel it is like calling the whole battalion when a commando
would do.

Didn't BarryK once come up with a trimmed-down browser expressly
designed for viewing simple texts? Maybe it is not in the recent Pups
anymore, but it was quite useful for this kind of job. He used it to display his
Puppy Help file with it, remember? (In the Puppy-4 series, I think.)

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

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#50 Post by MochiMoppel »

Argolance wrote:
fredx181 wrote:I found that it works ok also if you move part of it to the next line and make the width again 100 (as it was how you did).
Yes, and with this solution it is sure that all users will have quite the same perfect display. :wink:
Well, let's call it *almost* perfect. Xdialog with tabs still displays jagged lines (see screenshot)

Unless you insist on using Xdialog you might get better results with gxmessage. I replaced tabs in websearch_engines_en.txt with spaces and changed

Code: Select all

Xdialog --title "WebSearch - $(gettext 'Engines Info')" --left --no-cancel --textbox "/usr/local/websearch/help_files/websearch_engines_$lng2.txt" 30 100
to

Code: Select all

gxmessage -title "WebSearch - $(gettext 'Engines Info')" -fn monospace -geometry 710x420 -file "/usr/local/websearch/help_files/websearch_engines_en.txt"
At least columns are guaranteed to line up.

The error message regarding internet access is more severe and a show stopper. My connection is working fine but.... :cry:
Attachments
websearch.png
(73.34 KiB) Downloaded 270 times

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

#51 Post by musher0 »

Thanks for the tip about gxmessage, MochiMoppei.

~~~~~~~~~

I do not know if the following will help you, but here goes: I got that
same absurd "no connection" message -- while connected -- when I
tried to substitute www.ask.com for google.com at lines 15-16.
Please see here, 2nd par.

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

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#52 Post by MochiMoppel »

The duck refuses to go. This internet check produced the error:

Code: Select all

wget --quiet --spider http://duckduckgo.com
Removing the --quiet option shows why:

Code: Select all

# wget  --spider https://duckduckgo.com ; echo $?
Spider mode enabled. Check if remote file exists.
--2018-12-21 16:45:22--  https://duckduckgo.com/
Resolving duckduckgo.com (duckduckgo.com)... 54.254.135.186, 46.51.219.131
Connecting to duckduckgo.com (duckduckgo.com)|54.254.135.186|:443... connected.
ERROR: cannot verify duckduckgo.com's certificate, issued by ‘/C=US/O=DigiCert Inc/CN=DigiCert SHA2 Secure Server CA’:
  Unable to locally verify the issuer's authority.
To connect to duckduckgo.com insecurely, use `--no-check-certificate'.
5
The address http://duckduckgo.com works fine when entered manually into my Opera 11.64.
The wget command produced no error when adding the --no-check-certificate option.

But here is my next problem: What is supposed to happen after pushing the Find button? Where can I see the search results?

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

#53 Post by fredx181 »

MochiMoppel wrote:But here is my next problem: What is supposed to happen after pushing the Find button? Where can I see the search results?
In your browser. Maybe you don't have "xdg-open" ?

Fred

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#54 Post by MochiMoppel »

fredx181 wrote:Maybe you don't have "xdg-open" ?
I have xdg-open

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

#55 Post by fredx181 »

MochiMoppel wrote:I have xdg-open
Ok, and what happens when run from terminal ?:

Code: Select all

xdg-open https://duckduckgo.com

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#56 Post by MochiMoppel »

This:

Code: Select all

# xdg-open https://duckduckgo.com
<?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://duckduckgo.com: no handler for https</faultstring></env:Fault></env:Body></env:Envelope>

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

#57 Post by fredx181 »

The /usr/local/bin/xdg-open from slacko 6.9.9.9 works for me (opens URL in defaultbrowser):

Code: Select all

#!/bin/sh
#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
                ;;
#        magnet:*) exec transmission "$1" 
#                ;;
        *://*) exec defaultbrowser "$1" 
                ;;
        *@*.*) exec rox -U "mailto:${1}"
                ;;
        *) exec rox "$1"
                ;;
esac
Looks like you have a different xdg-open script.

@Argolance Maybe better to replace xdg-open with defaultbrowser ?
(or, better maybe, check first if defaultbrowser exists, if not, use xdg-open)

Fred

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#58 Post by MochiMoppel »

fredx181 wrote:Looks like you have a different xdg-open script.
Indeed.

Code: Select all

#!/bin/sh
#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.

#!/bin/bash
case "$1" in 
        '') exit
                ;;
        *://*) exec rox -U "$1"
                ;;
        *@*.*) exec rox -U "mailto:${1}"
                ;;
        *) exec rox "$1"
                ;;
esac
In principle exec rox -U "$1" works fine if the protocol is http, which nowadays it seldom is. With https it fails.

As for the internet check: Why check internet connection at all? If there really is no connection the error message produced by the browser would be much more meaningful. Would save code and frustration.

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

#59 Post by fredx181 »

MochiMoppel wrote:As for the internet check: Why check internet connection at all? If there really is no connection the error message produced by the browser would be much more meaningful. Would save code and frustration.
Good point Santa Mochi :lol:

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

#60 Post by Argolance »

Bonsoir,
Sorry, I am not at home and just type some words from a friend's PC. So, in a hurry:
MochiMoppel wrote:This:
Code:
# xdg-open https://duckduckgo.com
<?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 ... duckgo.com: no handler for https</faultstring></env:Fault></env:Body></env:Envelope>
:arrow: http://murga-linux.com/puppy/viewtopic. ... 7&start=12
Unless you insist on using Xdialog you might get better results with gxmessage. I replaced tabs in websearch_engines_en.txt with spaces and changed
It seems that you did not use the fredx181's text file as it is formatted, using | instead of tabs:
engine1|type1
engine2|type2
engine3|type3
...
This way and with a mono font set in a gtkrc file, it works really fine for any OS.
Something else: a newer version of wget may solve the problem using another URL than the Google one.

Cheers.

Post Reply