Buchempfehlung
Visual Basic 6 Kochbuch
Visual Basic 6 Kochbuch
Viele praktische Tipps zum Programmieren mit Visual Basic 6, die sich oft auch auf FB übertragen lassen. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Zufallszitat von Zitate.net (vll für IRC-bots interresant)

Uploader:MitgliedThe_Muh
Datum/Zeit:13.02.2009 21:52:31

#include once "TSNE_V3.bi"
Dim G_Client as UInteger

Declare Sub    TSNE_Disconnected    (ByVal V_TSNEID as UInteger)
Declare Sub    TSNE_Connected        (ByVal V_TSNEID as UInteger)
Declare Sub    TSNE_NewData        (ByVal V_TSNEID as UInteger, ByRef V_Data as String)

Dim BV as Integer

BV = TSNE_Create_Client(G_Client, "www.zitate.net", 80, 0, @TSNE_Connected, @TSNE_NewData, 60)

If BV <> TSNE_Const_NoError Then
    Print "[FEHLER] " & TSNE_GetGURUCode(BV)        'Fehler ausgeben
    End -1                                            'Programmbeenden
End If

TSNE_WaitClose(G_Client)
End


sub TSNE_Connected(ByVal V_TSNEID as UInteger)
    Dim CRLF as String = Chr(13, 10)
    Dim D as String

    D += "GET / HTTP/1.1" & CRLF
    D += "Host: zitate.net" & CRLF
    D += "connection: close" & CRLF
    D += CRLF

    Dim BV as Integer = TSNE_Data_Send(V_TSNEID, D)
    If BV <> TSNE_Const_NoError Then
        Print "[FEHLER] " & TSNE_GetGURUCode(BV)        'Fehler ausgeben
    End If
End Sub

Sub TSNE_NewData (ByVal V_TSNEID as UInteger, ByRef V_Data as String)    'Empfänger für neue Daten
    dim position as integer = instr(v_data, "title=""Zur Detailansicht."">")
    dim as string dummy, dummy2
    if position then dummy = mid(v_data, position, instr(position, v_data, "</span>") - position )
    dummy = right(dummy, len(dummy) - instr(dummy, ">"))
    if dummy = "" then exit sub
    do
        if instr(dummy, "<") then
            position = instr(dummy, "<")
            dummy = left(dummy, position-1) & right(dummy, len(dummy) - instr(position,dummy, ">"))
        else : exit do
        end if
    loop
    position =  instr(position, v_data, "<a href=""/autoren")
    if position then dummy2 = mid(v_data, position, instr(position, v_data, "</a>") - position )
    dummy2 = right(dummy2, len(dummy2) - instr(dummy2, ">"))
    if left(dummy2, 1) = "<" then
        position = instr(dummy2, "title=""")
        dummy2 = right(dummy2, len(dummy2) - instr(position, dummy2, "=")-1)
        dummy2 = left(dummy2, instr(dummy2, ",")-1)
    end if
    print dummy & chr(13,10) &" - " &dummy2
    print ""
    end
End Sub