Page 1 of 5

HMG Forum "Codebox" Reader

Posted: Fri Aug 05, 2022 10:20 pm
by AUGE_OHR
hi,

i FiveWin Forum i found a Tool to read "Codebox" from PhpBBs Website an "extract" it
"Codebox" is the Tag <Code> and </Code>

Code: Select all

LOCAL c_Marker := "codebox"
LOCAL c_Start  := "<code>"
LOCAL c_Ende   := "</code>"
LOCAL c_URL := "http://www.hmgforum.com/viewtopic.php?f=5&t=7281"
LOCAL cFile, cMemo 

      DownloadFromWWW( c_Url, cFile )
      cMemo   := MEMOREAD(cFile)

      nPosi := HB_AT(c_Marker, cMemo, nStart )
      IF nPosi > 0
         nStart := nPosi + LEN(c_Marker)

         nPosi := HB_AT(c_Start, cMemo, nStart )
         IF nPosi > 0
            nStart := nPosi + LEN(c_Start)

            nPosi := HB_AT(c_Ende, cMemo, nStart )
            IF nPosi > 0
               nEnde := nPosi
               cReturn := SUBSTR(cMemo,nStart, nEnde-nStart) + CRLF
 MsgInfo(cReturn,cRef+cVal)
               nStart := nPosi + LEN(c_Ende)
            ENDIF
         ENDIF
      ENDIF
does a Tool like this exist for HMG Forum :?:

Re: HMG Forum "Codebox" Reader

Posted: Sat Aug 06, 2022 10:44 pm
by AUGE_OHR
hi,

i have begin to make a Sample but as i´m not a Internet Guru i have Problem with HTML Code.

i download Website from Forum and than use MEMOLINE() and looking for "Keyword"

Code: Select all

   CASE EMPTY(cLine)
   CASE "<title>" $ cLine
   CASE '<h3 class="first"><a href='  $ cLine
   CASE cRef $ cLine     // "https://www.hmgforum.com/viewtopic.php?t="
   CASE "codebox" $ cLine
   CASE "<code>" $ cLine
   CASE "</code>" $ cLine
   CASE lCode = .T.     // belonh to CODE
   CASE "datetime=" $ cLine
   CASE "/memberlist.php?mode=viewprofile&amp;u=" $ cLine
   CASE 'class="username' $ cLine
that seem to give me Information i want ...

Question : is there a better Method to "analyse" a Webpage ?

now there can be 2nd Page ... it use "&Start="
normal it will be +10 ... but i also can type 99

Code: Select all

https://www.hmgforum.com/viewtopic.php?f=24&t=7217&start=99
if there is "only" 2 x Page it will show same Page with +10 and +99 ... :(
how can i find out which is last Number of a Thread :?:

Re: HMG Forum "Codebox" Reader

Posted: Sun Aug 07, 2022 7:08 am
by serge_girard
Jimmy,

I think you will have to make yourself a specific program for this need. Does it work with https websites?

Serge

Re: HMG Forum "Codebox" Reader

Posted: Mon Aug 08, 2022 4:10 am
by AUGE_OHR
hi Serge,

i have made Sample which show what i mean

i like to have Database to search "Local" e.g. when can not connect to Forum
ForumHMG.jpg
ForumHMG.jpg (124.36 KiB) Viewed 46991 times
it does collect Message from HMG Forum and can "extract CODE"
it also collect Message BODY to search for
FORUMHMG.ZIP
(1.76 MiB) Downloaded 754 times
"Problem" : both include HTML "Tag" ...

---

on Top i made 2 x ComboBox
1.) Forum Name (can be every phpBB System )
2.) Forum Category

but they are no "filled" in this Demo
also "Download" Source is not "activate"

but Button "Link" is working so you can goto Original

---

Radio Button ( not resize ? ) is to SET FILTER

Code: Select all

 SET FILTER TO !DELETED()
 SET FILTER TO !EMPTY(FORUM->BODY) .AND. !DELETED()
 SET FILTER TO !EMPTY(FORUM->CODE) .AND. !DELETED()
 SET FILTER TO !EMPTY(FORUM->BODY) .AND. !EMPTY(FORUM->CODE) .AND. !DELETED()
---

Start Demo using

Code: Select all

   FORUMHMG.exe JIMMY.DBF
Default is HMGFORUM.DBF (will be create)

---

todo :
FILTER for Author and "Keyword"
MENU : "Download"
DBF with Forum Category

do you like Idea :?:

Re: HMG Forum "Codebox" Reader

Posted: Mon Aug 08, 2022 6:00 am
by serge_girard
Hi Jimmy,

Works great and I like the idea very much! I used to do these 'grabs' for several websites!

Serge

Re: HMG Forum "Codebox" Reader

Posted: Sat Aug 13, 2022 2:38 am
by Rathinagiri
Great utility! Nice idea.

Re: HMG Forum "Codebox" Reader

Posted: Sat Aug 13, 2022 6:03 am
by AUGE_OHR
hi,

i "think" i got download and "analyze" so far

but i made a Mistake in Design Concept ... :roll:

this is what i "see" in Browser
https://www.hmgforum.com/viewtopic.php?f=5&t=2
so i try

Code: Select all

cURL := cRef + cCategory + cThread + LTRIM( STR( ii ) )
which "seems" to work but "real" it is
https://www.hmgforum.com/viewtopic.php?f=2&t=2

so only &t=2 is "valid" and i got Message from all "Category" (f=) ... hm ...

---

in download Website i do not found anything what can be used for "Category"
so my 2nd Combobox is "useless" as i can not "FILTER" on "Category" in my Concept yet

when press "Link" Button i got to right Thread but without "F="
if there is a second Page URL, Browser it will change and include "F="

i guess PhpBB is doing that "Trick" so there must be some Data which "know" that "T=" is assign to "F="
so i need help from Moderator how to get these Information for Category ( if we want to use "Category" )

i have to overthink my Concept and rewrite without using "Category"

Re: HMG Forum "Codebox" Reader

Posted: Sun Aug 14, 2022 6:15 am
by AUGE_OHR
hi,

here 1st Release of "PhpBB Forum Grabber"
phpBB_Forum_Grabber.JPG
phpBB_Forum_Grabber.JPG (209.79 KiB) Viewed 46823 times
FORUMHMG_18.zip
(1.55 MiB) Downloaded 640 times
Start App and press F7 to get 100 Thread
it will take about 50 Sec
look into Statusbar when finish before "big" Download ( > 1 Hour )

---

App will create
FORUMDIR.DBF
HTMLSIGN.DBF

FORUM.DBF
FORUM.fpt
FORUM.CDX
you can change FORUMDIR->LOCALPATH to your Folder
! Note : for Network use UNC-Path (no Drive Letter)

FORUM.DBF is to hold Message of a Forum (see FORUMDIR->LOCALPATH )
use separate Folder if you watch more PhpBB Forum***

HTMLSIGN.DBF include String with HTML-Code with can be used with

Code: Select all

STRTRAN(FIELD-BODY,HTMLSIGN->HTMLSIGN,HTMLSIGN->CHANGETO)
See Menu
---

CTRL + F will open Window for"Keyword" and/of "Author"
"Keyword" in RTF will use Method "FindText" to show what found in BODY ( not in CODE (yet) )

---

***
it does work well with HMG Forum but with Xbase++ Forum many "Topic" are empty
BODY and CODE and all other Information of HTML File are OK, so you can work with it

Todo :
"Translate" BODY to other Language

Re: HMG Forum "Codebox" Reader

Posted: Sun Aug 14, 2022 6:50 am
by serge_girard
Thanks Jimmy !

Re: HMG Forum "Codebox" Reader

Posted: Sun Aug 14, 2022 8:33 am
by AUGE_OHR
hi,

"phpBB Froum Grabber" work well now with HMG and Xbase++ phpBB Forum :D
but with FiveWin Forum i have Problem with Date/Time Format
&raquo; Thu Oct 06, 2005 6:24 pm </p>
&raquo; Thu Oct 06, 2005 8:28 pm </p>
&raquo; Fri Oct 07, 2005 7:11 pm </p>
&raquo; Sun Feb 26, 2006 9:17 am </p>
how can i convert those Date/Time String into this Format :?:

Code: Select all

YYYY-MM-DD HH:MM:SS