WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Enhancing the "Browse TCZs" Webpage with an Automated Script  (Read 11270 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #15 on: July 18, 2018, 12:30:53 PM »
Now enabled for 9.x. Some info file errors may remain.
The only barriers that can stop you are the ones you create yourself.

Offline Nathan_SR

  • Jr. Member
  • **
  • Posts: 82
    • Quick-Save-Live
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #16 on: July 18, 2018, 02:40:54 PM »
Yes, I checked it now, on both my laptop and a smart phone. Wow !
It took just 1 second to load the entire page, in spite of carrying so much data. Credits to your webserver.

A couple of little things, that remain:

1. The search.png file needs to be copied to the new index.html folder. Once copied, the "Browse TCZs" page should display this icon on the left edge of "Search in all Fields" text box.

2. The version "a" of this script/index.html can extend as a Wiki Page named "List of Extensions" and will contribute to Users/Maintainers in different ways.

BTW, Congrats on getting this implemented, at such a rapid pace.

Offline Nathan_SR

  • Jr. Member
  • **
  • Posts: 82
    • Quick-Save-Live
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #17 on: July 18, 2018, 10:19:32 PM »
I missed out an important point in my previous message.

3. If you are planning to deploy this script, as a Cron Job as well, then a couple of additional settings might be required, inside this script:

a. cd full_path_to_info_files  #### script will pick up the info files from here

b. export PATH=current_path_setting_to_all_binaries

Hope the first test run of the cron job will reveal, if anything else is required.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #18 on: July 19, 2018, 04:28:51 AM »
The PNG file will not display at all in old browsers, so copying it to every folder didn't seem necessary. Browsers new enough to display it also display the placeholder text.
The only barriers that can stop you are the ones you create yourself.

Offline Nathan_SR

  • Jr. Member
  • **
  • Posts: 82
    • Quick-Save-Live
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #19 on: July 19, 2018, 06:00:24 AM »
I got what you are saying. Atleast for the newer browsers, it will display a nice search icon, like the one at : http://wiki.tinycorelinux.net/ search box. It will require a one time effort though.

aus9

  • Guest
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #20 on: July 20, 2018, 11:17:06 PM »
Hi Nathan_SR

1) I have 64 and often run firefox on 64 bit

so firstly I installed the FF addon as per
https://addons.mozilla.org/en-US/firefox/addon/table-to-excel/?src=search

and pointed my FF to
https://distro.ibiblio.org/tinycorelinux/9.x/x86_64/tcz/

and that appears to work altho, its not useful enough for me at this stage......so

2) I downloaded tabulate scripts version 4 and download_all_info_files.sh

I have not downloaded any index html file as I assume they are 32 bit, so am attempting to generate a 64 bit html

I installed it to my .local/bin and made it executable
I amended it to read
Code: [Select]
#!/bin/bash
tce-load -i wget
mkdir tcz.info.files.folder
cd tcz.info.files.folder
pwd
# Check URL at the End of the Below Command For Any Modification Required
wget -e robots=off --no-check-certificate -r -l1 -np -nd -A ".info" https://distro.ibiblio.org/tinycorelinux/9.x/x86_64/tcz/

I had to load wget as my busybox wget was not able to handle no-check-certificate and as you can see just the 64 bit repo changed too

I get this error?

Code: [Select]
sh download_all_info_files.sh
wget is already installed!
/home/tc/.local/bin/tcz.info.files.folder
--2018-07-21 10:57:36--  https://distro.ibiblio.org/tinycorelinux/9.x/x86_64/tcz/
Resolving distro.ibiblio.org... 152.19.134.43
Connecting to distro.ibiblio.org|152.19.134.43|:443... connected.
WARNING: The certificate of ‘distro.ibiblio.org’ is not trusted.
WARNING: The certificate of ‘distro.ibiblio.org’ hasn't got a known issuer.
HTTP request sent, awaiting response... 200 OK
Length: 241884 (236K) [text/html]
Saving to: ‘index.html’

100%[=====================================================>] 241,884      176KB/s   in 1.3s   

2018-07-21 10:57:38 (176 KB/s) - ‘index.html’ saved [241884/241884]

Removing index.html since it should be rejected.

FINISHED --2018-07-21 10:57:38--
Total wall clock time: 2.4s
Downloaded: 1 files, 236K in 1.3s (176 KB/s)
tc@box:~/.local/bin$ ls
download_all_info_files.sh  get-dep-list.sh  sound    wifi
elog     kernel      tabulate_script_version_c.sh
fox     search.png      tcz.info.files.folder/

I attempted a root search for index.html get no hits

how can I stop it from "Removing index.html since it should be rejected." ?

thanks in advance

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11698
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #21 on: July 20, 2018, 11:29:50 PM »
Hi aus9
... I have not downloaded any index html file as I assume they are 32 bit, so am attempting to generate a 64 bit html ...
To the best of my knowledge, HTML files are text based and do not come in 32 or 64 bit flavors.

aus9

  • Guest
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #22 on: July 21, 2018, 01:04:20 AM »
fair enough

any clues why its created and then immediately deleted?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11698
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #23 on: July 21, 2018, 02:30:18 AM »
Hi aus9
... any clues why its created and then immediately deleted?
Based on what you posted, it looks like it's being done by  download_all_info_files.sh.  It probably downloads the index file
to create the list of info files to download. Once it's done that, it probably no longer needs the index and thus deletes it.

Offline Nathan_SR

  • Jr. Member
  • **
  • Posts: 82
    • Quick-Save-Live
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #24 on: July 21, 2018, 05:33:47 AM »
Thanks Rich for being very helpful, as always.

Hi Aus9,

The -A option of wget filters files on the extensions given and removes others that don’t match. You can give .html here if you require. BTW, are you preparing a 64 bit version of the new Browse TCZ webpage ? Then, downloading all the 64 bit info files first and then running the tabulate.sh in that folder, should generate a new index.html in that folder. Hope this helps.

aus9

  • Guest
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #25 on: July 21, 2018, 07:12:29 AM »
I got the index.html to download via below command but I am attempting to get all info files from repo  and not my TCEDIR
Code: [Select]
wget -e robots=off --no-check-certificate -r -l1 -np -nd -A ".html" https://distro.ibiblio.org/tinycorelinux/9.x/x86_64/tcz/
sorry but I am running it from .local/bin and not my tcedir...sorry if not clear early

anyhow new error is
Code: [Select]
sh tcz.info.files.folder/tabulate_script_version_c.sh
cat: can't open '*.tcz.info': No such file or directory
tcz.info.files.folder/tabulate_script_version_c.sh: line 141: syntax error: unexpected "(" (expecting "then")

I am not a real coder so umm I have other things to do. sorry to have troubled you

Offline Nathan_SR

  • Jr. Member
  • **
  • Posts: 82
    • Quick-Save-Live
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #26 on: July 21, 2018, 08:01:09 AM »
Hi Aus9,

Yes, the error message is pretty clear.

First, type this on your terminal :

cd tcz.info.files.folder

Then:

sh tabulate_script_version_c.sh

Hope, you have got some info files already in that folder. Just check:

ls -lt *.tcz.info | wc -l

which should return a count greater than 1.

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #27 on: July 21, 2018, 10:13:59 PM »
I am not sure if I am following this 100%, but tce-fetch.sh is handy for getting .info files as well as others.

Here is a list of standard Tiny Core commands. When I developed a web interface for manipulating extensions for pCP I found the Tiny Core guys had already written *all* the required scripts.

http://wiki.tinycorelinux.net/wiki:tc_commands

Note: An important script,  search.sh is missing from the list.

Offline Nathan_SR

  • Jr. Member
  • **
  • Posts: 82
    • Quick-Save-Live
Re: Enhancing the "Browse TCZs" Webpage with an Automated Script
« Reply #28 on: July 21, 2018, 10:39:45 PM »
Thanks Greg for the info....