UHTML Web Markup language Beta(Moooolto beta)

« Older   Newer »
  Share  
-Anubi-
CAT_IMG Posted on 12/5/2010, 14:49     +1   -1




Interprete per il linguaggio uhtml ( in fase di creazione )
SPOILER (click to view)
#include <buttonconstants.au3>
#include <editconstants.au3>
#include <guiconstantsex.au3>
#include <windowsconstants.au3>
#include <file.au3>


$Form1 = GUICreate("UHTML Browser", 633, 447, 377, 315)
$UHTLM = GUICtrlCreateEdit("", 8, 8, 609, 377,$ES_READONLY)
GUICtrlSetData(-1, "UHTLM")
$http = GUICtrlCreateInput("http://", 8, 392, 609, 21)
$Button1 = GUICtrlCreateButton("Go", 8, 416, 105, 25, $WS_GROUP)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
FileDelete ( @TempDir & "\UHTML.REA" )
$txt = ""
$lis = ""
$url = GUICtrlRead ( $http )
InetGet ( $url, @TempDir & "\UHTML.REA" )

$tit = FileReadLine ( @TempDir & "\UHTML.REA", 1 )
$title = StringReplace ( $tit, "-Title:/", "" )
WinSetTitle ( "[ACTIVE]", "", $title )
$COlorS = FileReadLine ( @TempDir & "\UHTML.REA", 2 )
$COlor = StringReplace ( $COlorS, "-ColorS:/", "" )
GUICtrlSetBkColor ( $UHTLM, $COlor )
$lin = _FileCountLines(@TempDir & "\UHTML.REA")
Local $i, $lis, $txt
For $i = 3 To $lin
Sleep(100)
$lis = FileReadLine(@TempDir & "\UHTML.REA", $i)
If NOT $lis = "" Then
$txt = $txt & @CRLF & $lis
EndIf
Next

GUICtrlSetData ( $UHTLM, "" )
GUICtrlSetData ( $UHTLM, $txt )






EndSwitch
WEnd


Edited by -Anubi- - 12/5/2010, 17:52
 
Top
Grandebestia
CAT_IMG Posted on 12/5/2010, 16:20     +1   -1




Beh devo dire che è molto beta, tanto beta che a me non funziona!
 
Top
-Anubi-
CAT_IMG Posted on 12/5/2010, 16:45     +1   -1




Forse perchè devi andare su una pagina uhtml ?
 
Top
Kurt_Black_hat 2.0
CAT_IMG Posted on 12/5/2010, 18:23     +1   -1




CITAZIONE (-Anubi- @ 12/5/2010, 17:45)
Forse perchè devi andare su una pagina uhtml ?

Spiegaci cosa cazzo è
e come cazzo si usa
non è possibile che apri i topic e non spieghi quello che pubblichi.
Non è la prima volta che te lo dico, sei già warnato, stai attento.
 
Top
-Anubi-
CAT_IMG Posted on 12/5/2010, 18:27     +1   -1




CITAZIONE (Kurt_Black_hat 2.0 @ 12/5/2010, 19:23)
CITAZIONE (-Anubi- @ 12/5/2010, 17:45)
Forse perchè devi andare su una pagina uhtml ?

Spiegaci cosa cazzo è
e come cazzo si usa
non è possibile che apri i topic e non spieghi quello che pubblichi.
Non è la prima volta che te lo dico, sei già warnato, stai attento.

-.-" dal codice si capisce...
Interpreta pagine uhtml, un linguaggio di markup in fase di creazione inventato da Anubi, la pagina di test è http://hackbadb.altervista.org/Index.uhtml
La sintassi per creare una pagina uhtml è :
-Title:/Titolo
-ColorS:/0x00ff00 (Il colore insomma)
 
Top
Sbarabau
CAT_IMG Posted on 12/5/2010, 18:52     +1   -1




Bello! Mi hai dato una bellissima idea!
 
Top
-Anubi-
CAT_IMG Posted on 12/5/2010, 18:53     +1   -1




Ma Anubi dà idee a tutti ? xD Almeno dite che l'idea era di Anubi xD
 
Top
ACIDBURN16
CAT_IMG Posted on 12/5/2010, 19:32     +1   -1




Puntualizza nessuno mai ti ha rubato idee o cose varie :D
 
Top
-Anubi-
CAT_IMG Posted on 13/5/2010, 13:04     +1   -1




E invece sì, vero Acid ?? :D
 
Top
ACIDBURN16
CAT_IMG Posted on 13/5/2010, 13:17     +1   -1




Puntualizza ti ho detto non fare il finto tonto con me.
 
Top
-Anubi-
CAT_IMG Posted on 13/5/2010, 13:35     +1   -1




nonononononono
 
Top
Sbarabau
CAT_IMG Posted on 13/5/2010, 14:44     +1   -1




Il progetto mi piace ^^
Ho migliorato alcune cose al source e ho aggiunto anche l'analisi della funzione "hr" (che c'è anche nell'html)

SPOILER (click to view)
CODICE
#include <buttonconstants.au3>
#include <editconstants.au3>
#include <guiconstantsex.au3>
#include <windowsconstants.au3>
#include <file.au3>

Global $Riga_Titolo, $Riga_Background

$Gui = GUICreate ("UHTML Browser", 633, 447)
$Uhtml = GUICtrlCreateEdit ("", 8, 8, 609, 377, $ES_READONLY)
GUICtrlSetData (-1, "UHTLM")
$Link = GUICtrlCreateInput ("http://", 8, 392, 609, 21)
$Leggi = GUICtrlCreateButton ("Go", 8, 416, 105, 25, $WS_GROUP)
GUISetState (@SW_SHOW)


While 1=1
 Switch GUIGetMsg ()
  Case $GUI_EVENT_CLOSE
    If FileExists (@TempDir & "\WebPage.uhtml") Then FileDelete (@TempDir & "\WebPage.uhtml")
        Exit
  Case $Leggi
        Local $i, $lis, $Testo_Finale
        If FileExists (@TempDir & "\WebPage.uhtml") Then FileDelete (@TempDir & "\WebPage.uhtml")
    $Testo_finale = ""
    $Righe_Uhtml = ""
    $Url = GUICtrlRead ($Link)
    InetGet ($Url, @TempDir & "\WebPage.uhtml")
        $Lunghezza_File_Uhtml = _FileCountLines(@TempDir & "\WebPage.uhtml")
          For $i = 1 To $Lunghezza_File_Uhtml
            If StringInStr (FileReadLine (@TempDir & "\WebPage.uhtml" ,$i), "-Title:/") Then $Riga_Titolo = $i        
            If StringInStr (FileReadLine (@TempDir & "\WebPage.uhtml" ,$i), "-Background_Color:/") Then $Riga_Background = $i  
          Next
        $Leggi_Titolo = FileReadLine (@TempDir & "\WebPage.uhtml", $Riga_Titolo)
        $Titolo_Gui = StringReplace ($Leggi_Titolo, "-Title:/", "")
    WinSetTitle ($Gui, "", $Titolo_Gui)
    $Background = FileReadLine (@TempDir & "\WebPage.uhtml", $Riga_Background)
        $Background_Color = StringReplace ($Background, "-Background_Color:/", "")
        GUICtrlSetBkColor ($Uhtml, "0x" & $Background_Color)
          For $i = 3 To $Lunghezza_File_Uhtml
            $Riga_attuale = FileReadLine(@TempDir & "\WebPage.uhtml", $i)
                If Not $Riga_attuale = "" Then
                  If StringInStr ($Riga_attuale, "<hr>") Then
                    ;<hr>
                        If $Riga_attuale = "<hr>" Then
                         $Riga_Attuale = StringReplace ($Riga_attuale, "<hr>", "--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
                    Else
                         $Riga_Attuale = StringReplace ($Riga_attuale, "<hr>", @CRLF & "--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF)
                        EndIf
                        $Testo_Finale &= $Riga_attuale & @CRLF
                  Else
                    $Testo_Finale &= $Riga_attuale & @CRLF
              EndIf
                EndIf
          Next
        FileDelete (@TempDir & "\WebPage.uhtml")
        GUICtrlSetData ($Uhtml, "" )
        GUICtrlSetData ($Uhtml, $Testo_Finale)
 EndSwitch
WEnd


Edited by Sbarabau - 13/5/2010, 18:50
 
Top
-Anubi-
CAT_IMG Posted on 13/5/2010, 15:52     +1   -1




Grazie, comunque era beta...il progetto andrà avanti, ma ovviamente per le immagini non c'è speranza :(
 
Top
Sbarabau
CAT_IMG Posted on 13/5/2010, 16:28     +1   -1




Per le immagini ci stavo pensando anch'io ma per adesso non trovo nessuna soluzione
 
Top
Sbarabau
CAT_IMG Posted on 13/5/2010, 18:13     +1   -1




Implementata la funzione per leggere anche i file in locale
SPOILER (click to view)
CODICE
#include <EditConstants.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <File.au3>

Global $Riga_Titolo, $Riga_Background

$Gui = GUICreate ("UHTML Browser", 630, 445)
$Uhtml = GUICtrlCreateEdit ("", 5, 5, 620, 377, $ES_READONLY)
GUICtrlSetData (-1, "UHTLM")
$Link = GUICtrlCreateInput ("http://", 5, 392, 620, 21)
$Internet = GUICtrlCreateButton ("Leggi url", 5, 415, 80, 25)
$Locale = GUICtrlCreateButton ("Apri file...", 90, 415, 80, 25)
GUISetState (@SW_SHOW)


While 1=1
 Switch GUIGetMsg ()
  Case $GUI_EVENT_CLOSE
    If FileExists (@TempDir & "\WebPage.uhtml") Then FileDelete (@TempDir & "\WebPage.uhtml")
        Exit
  Case $Internet
    GUICtrlSetData ($Uhtml, "")
        GUICtrlSetData ($Uhtml, _Leggi_UHTML (GUICtrlRead ($Link), 0))
  Case $Locale
    $Apri_File_Locale = FileOpenDialog ("Apri file", @DesktopDir, "File uhtml (*.uhtml)")
        If Not $Apri_File_Locale = "" Then
         GUICtrlSetData ($Uhtml, "")
         GUICtrlSetData ($Uhtml, _Leggi_UHTML ($Apri_File_Locale, 1))
        EndIf
 EndSwitch
WEnd

Func _Leggi_UHTML ($Url, $Internet_o_Locale)
        Local $i, $lis, $Testo_Finale
        If FileExists (@TempDir & "\WebPage.uhtml") Then FileDelete (@TempDir & "\WebPage.uhtml")
    $Testo_finale = ""
    $Righe_Uhtml = ""
    If $Internet_o_Locale = 0 Then
         InetGet ($Url, @TempDir & "\WebPage.uhtml")
    ElseIf $Internet_o_Locale = 1 Then
         FileCopy ($Url, @TempDir & "\WebPage.uhtml")
        EndIf
        $Lunghezza_File_Uhtml = _FileCountLines(@TempDir & "\WebPage.uhtml")
          For $i = 1 To $Lunghezza_File_Uhtml
            If StringInStr (FileReadLine (@TempDir & "\WebPage.uhtml" ,$i), "-Title:/") Then $Riga_Titolo = $i        
            If StringInStr (FileReadLine (@TempDir & "\WebPage.uhtml" ,$i), "-Background_Color:/") Then $Riga_Background = $i  
          Next
        $Leggi_Titolo = FileReadLine (@TempDir & "\WebPage.uhtml", $Riga_Titolo)
        $Titolo_Gui = StringReplace ($Leggi_Titolo, "-Title:/", "")
    WinSetTitle ($Gui, "", $Titolo_Gui)
    $Background = FileReadLine (@TempDir & "\WebPage.uhtml", $Riga_Background)
        $Background_Color = StringReplace ($Background, "-Background_Color:/", "")
        GUICtrlSetBkColor ($Uhtml, "0x" & $Background_Color)
          For $i = 3 To $Lunghezza_File_Uhtml
            $Riga_attuale = FileReadLine(@TempDir & "\WebPage.uhtml", $i)
                If Not $Riga_attuale = "" Then
                  If StringInStr ($Riga_attuale, "<hr>") Then
                    ;<hr>
                        If $Riga_attuale = "<hr>" Then
                         $Riga_Attuale = StringReplace ($Riga_attuale, "<hr>", "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
                    Else
                         $Riga_Attuale = StringReplace ($Riga_attuale, "<hr>", @CRLF & "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" & @CRLF)
                        EndIf
                        $Testo_Finale &= $Riga_attuale & @CRLF
                  Else
                    $Testo_Finale &= $Riga_attuale & @CRLF
              EndIf
                EndIf
          Next
        FileDelete (@TempDir & "\WebPage.uhtml")
        Return $Testo_Finale
EndFunc
 
Top
16 replies since 12/5/2010, 14:49   204 views
  Share