STUSK (Stupid site keeper)

Share your advanced PureBasic knowledge/code with the community.
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

8) That works as it should. :D

I'm still only half way through installing stuff, PB was one of first installed progs. :)

I had to change the OwnerName.s = line as RepQuote wasn't found.
Rather than checking your Sitelist sources, I just gave it a string.
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

That works as it should.
So, is that how you want the bookmarks imported? URL, Title, owner name set to current user login and category set to "FireFox Bookmarks" ?
I'm still only half way through installing stuff, PB was one of first installed progs. :)
Makes perfect sense to me:)
I had to change the OwnerName.s = line as RepQuote wasn't found.
Rather than checking your Sitelist sources, I just gave it a string.
Yes, I forgot about that, fixed it in my copy. RepQuote is used in my main program to 'escape' single quotes before saving to the database.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

Fangbeast wrote:
That works as it should.
So, is that how you want the bookmarks imported? URL, Title, owner name set to current user login and category set to "FireFox Bookmarks" ?
That will be great, I think the category could be "Imported Bookmark" rather than "Firefox Bookmark",
as it can also import from IE or other browser exported bookmark lists (as long as they're *.html)
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin wrote:
Fangbeast wrote:
That works as it should.
So, is that how you want the bookmarks imported? URL, Title, owner name set to current user login and category set to "FireFox Bookmarks" ?
That will be great, I think the category could be "Imported Bookmark" rather than "Firefox Bookmark",
as it can also import from IE or other browser exported bookmark lists (as long as they're *.html)
I don't know what IE exported bookmarks look like as I don't use it and have no favourites in it. Different browsers use different nonclemanture in their html handling and it might have to be handled differently.

Got it (IE) locked out of the system alltogether here. If you have a copy of a set of bookmarks, I can see if it will import the same.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

I tried a set of IE exported favourites, seemed to work fine (IE is v7)
As long as Sitelist can import the Firefox exported faves (as you have done) it will be enough.

I suppose if needed FF could import the IE ones then export them again.
%101010 = $2A = 42
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

Looking at the raw html file of the IE exported faves, it seems to try to follow the FF exported faves layout.
Without researching further may follow a previously set standard, as it also begins with.

Code: Select all

<!DOCTYPE NETSCAPE-Bookmark-file-1>
I don't know if different IE version exports different markup, but as I said earlier, if needed FF could import/export the required IE faves file (if it causes prob when imported directly).
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin wrote:Looking at the raw html file of the IE exported faves, it seems to try to follow the FF exported faves layout.
Without researching further may follow a previously set standard, as it also begins with.

Code: Select all

<!DOCTYPE NETSCAPE-Bookmark-file-1>
I don't know if different IE version exports different markup, but as I said earlier, if needed FF could import/export the required IE faves file (if it causes prob when imported directly).

If you have a set of exported, non private bookmarks, I can take a look at it still. I've already added the bookmarks import to SiteList but wasn't going to release it until you were sure it all worked.

In the meantime, try my code above on the IE ones and see if they 'look right' int he list.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin, i've found that my sample code works with IE bookmarks as I managed to get a hold of a file somewhere. The only difference between this one and FireFox bookmarks file was the title field coming up with ".URL" appended to it so I strip those if they exist.

Replace the OpenBookMarks() procedure with the one below and test it but I think I can issue an update for SiteList tonight in any case.

Code: Select all

Procedure OpenBookMarks()
  BookMarkFile.s = OpenFileRequester("Select FireFix Bookmarks file", Program\CurrentDir, "HTM (*.htm)|*.htm;*.html", 1)
  If BookMarkFile.s
    ExpressionId.i = CreateRegularExpression(#PB_Any, "\<[^\<]+\>")
    OwnerName.s = StringField(GetHomeDirectory(), 3, "\")
    InFileId.i = ReadFile(#PB_Any, BookMarkFile.s)
    If InFileId.i
      While Eof(InFileId) = 0
        TempString.s = ReadString(InFileId.i)
        If FindString(TempString.s, "<DT>", 1) And FindString(TempString.s, "A HREF", 1)
          TempURL.s   = StringField(TempString.s, 2, Chr(34))
          TempTitle.s = LTrim(RTrim(ReplaceRegularExpression(ExpressionId.i, TempString.s, "")))
          If LCase(Right(TempTitle.s, 4)) = ".url"
            TempTitle.s = Left(TempTitle.s, Len(TempTitle.s) - 4)
          EndIf
          AddGadgetItem(#Gadget_BookMarks_BookMarks, -1, TempURL.s + Chr(10) + TempTitle.s + Chr(10) + "FireFox BookMark" + Chr(10) + OwnerName.s)
        EndIf
      Wend
    Else
      Debug "Could not open the file off disk."
    EndIf
  Else
    Debug "User cancelled the file load."
  EndIf
EndProcedure
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

:oops:
Misread you're comment about 'Got it (IE) locked out of the system alltogether here.'

I thought you'd tried a IE exported file and got locked out / frozen system.
(Any IE exported faves file I tried worked ok)


The new import works great and all entries look ok.

:) If you still really want a set of my faves I can up them - :lol: HEAVILY edited of course to remove all the really embarrasing stuff, :lol: I'll leave the porn in though :lol:
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Misread you're comment about 'Got it (IE) locked out of the system alltogether here.'

I thought you'd tried a IE exported file and got locked out / frozen system.
(Any IE exported faves file I tried worked ok)
What I meant was..when I build a system, I download a little utility that removes the IE front-end so I have no access to it from then on. Of course, the underlying engine and functionality remains else a lot of things wouldn't work.

What I ended up doing was installing XP in virtualbox under windows 7 (which I run) so that I could import my firefox favourites and export the ie favourites to look at and you were right, they are no different, except for the heading and the title field has ".URL" appended to it.
The new import works great and all entries look ok.
Good to know.
:) If you still really want a set of my faves I can up them - :lol: HEAVILY edited of course to remove all the really embarrasing stuff, :lol: I'll leave the porn in though :lol
If it's sheep in underwear porn, leave them for that festering pile of sheepdip srod:):):)

Okay, next message is the update announcement.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Thanks to Perkin's request, the ability to import IE and FireFox HTM format favourites has been added.

Added All import routines were missing the transaction based commands for speed.

Added Owner combo gets updated after a bookmark update (or any other)

Added Category combo gets updated after an import session.

Added Window and statusbar locking to html import session.

Fixed On main import screen, selector said "FireFox BookMarks" instead of "InterNet BookMarks"

Changed Swapped Sitelist name and home page around in the html import section, looks better with a description first.

Changed Category name is changed from "FireFox BookMarks" to "Imported Bookmark"

Added Owner name is imported as the currently logged in system user.

Added After import, owner and category combo reset to last used.

Link is in the first post as usual. Version number hasn't changed.
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

Fangbeast wrote:
sheep in underwear porn
How did you know, are you spying on me, or just looking out for srod's depraved best interests :lol:



Thanks Fangbeast
%101010 = $2A = 42
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

Fangbeast wrote: What I meant was..when I build a system, I download a little utility that removes the IE front-end so I have no access to it from then on. Of course, the underlying engine and functionality remains else a lot of things wouldn't work.
What's the utility.

I tried a few before, to make FF default etc, but had a few probs with opening some files, opening links etc.

Does the WebGadget still work ok. (Normal and Mozilla)
%101010 = $2A = 42
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: STUSK (Stupid site keeper)

Post by Fangbeast »

Perkin wrote:
Fangbeast wrote: What I meant was..when I build a system, I download a little utility that removes the IE front-end so I have no access to it from then on. Of course, the underlying engine and functionality remains else a lot of things wouldn't work.
What's the utility.

I tried a few before, to make FF default etc, but had a few probs with opening some files, opening links etc.

Does the WebGadget still work ok. (Normal and Mozilla)
The WebGadget works fine here. As I said above, it removes the front end from access, not the engine itself which is needed for many things, especially in windows 7. But, I suggest you read here first!! http://support.microsoft.com/kb/957700

How did you go with the updated SiteList?
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Perkin
Enthusiast
Enthusiast
Posts: 504
Joined: Thu Jul 03, 2008 10:13 pm
Location: Kent, UK

Re: STUSK (Stupid site keeper)

Post by Perkin »

Fangles, I think you made a boo-boo :) , I can't Import *.html from the import requester, :(
only *.txt|*.csv|*xml - no *.html
About gives me v00.00.07 ( just in case I got wrong wrong version :wink: )

Regarding IE, I did before try various uninstall/blockers etc, but had a few problems.
I think it was opening links from within other programs, or from a WebGadget, I can't remember exactly what now.

I'll give it another try. I do usually use FF, but haven't removed IE's frontend because of previous probs.
I'll also have to try IncrediMail, just so I can use you're utility. (Thunderbird at moment)
%101010 = $2A = 42
Post Reply