- Offizieller Beitrag
Hi! Hier habe ich ein kleines aber feines skript geschrieben mit dem man gucken kann was das momentan aktuellste thema hier ist dessen autor und wann es erstellt wurde und von wem es das letzte mal beschrieben wurde und wann....
edit: natürlich von dem besten forum das es gibt *g* https://autoit.de/www.autoit.de
C
#include <file.au3>
#include <array.au3>
#include <GUIConstants.au3>
$Form1 = GUICreate("AForm1", 268, 123, 192, 125)
GUISetBkColor(0xA5BCEB)
$Input1 = GUICtrlCreateInput("Bitte Warten...", 8, 16, 121, 21, $ES_READONLY, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Titel", 10, 0, 29, 14)
GUICtrlSetBkColor(-1, 0xA5BCEB)
$Input2 = GUICtrlCreateInput("Bitte Warten...", 8, 56, 121, 21, $ES_READONLY, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Autor", 10, 40, 29, 14)
GUICtrlSetBkColor(-1, 0xA5BCEB)
$Input3 = GUICtrlCreateInput("Bitte Warten...", 8, 96, 121, 21, $ES_READONLY, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Geschrieben", 10, 80, 69, 14)
GUICtrlSetBkColor(-1, 0xA5BCEB)
$Input4 = GUICtrlCreateInput("Bitte Warten...", 144, 16, 121, 21, $ES_READONLY, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Letzter Beitrag von", 146, 0, 101, 14)
GUICtrlSetBkColor(-1, 0xA5BCEB)
$Input5 = GUICtrlCreateInput("Bitte Warten...", 144, 56, 121, 21, $ES_READONLY, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Geschrieben", 146, 40, 69, 14)
GUICtrlSetBkColor(-1, 0xA5BCEB)
$Button = GUICtrlCreateButton("&Aktualisieren", 144, 88, 115, 28)
GUISetState(@SW_SHOW)
GetLastPost()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button
GetLastPost()
;;;;;;
EndSelect
WEnd
Exit
Func GetLastPost($setdata = 1)
$file = "wg.php"
Dim $array
If $setdata = 1 Then
GUICtrlSetState($Button,$GUI_DISABLE)
GUICtrlSetData($Input1,"Bitte Warten...")
GUICtrlSetData($Input2,"Bitte Warten...")
GUICtrlSetData($Input3,"Bitte Warten...")
GUICtrlSetData($Input4,"Bitte Warten...")
GUICtrlSetData($Input5,"Bitte Warten...")
EndIf
InetGet("http://autoit.aufwaerts.de/portal.php",$file,1)
$string = FileRead($file,FileGetSize($file))
$strings = StringSplit($string,'<a href="thread.php?threadid=',1)
$strings = StringSplit($strings[2],">",1)
$strings = StringSplit($strings[2],"</a",1)
$threadtitle = $strings[1]
$strings = StringSplit($string,"<br /><b>",1)
$strings = StringSplit($strings[3],"</b>",1)
$threadday = $strings[1]
$strings = StringSplit($string,'<span class="time">',1)
$strings = StringSplit($strings[2],'</span>',1)
$threadtime = $strings[1]
_FileReadToArray($file,$array)
$threaddayline = _ArraySearch($array,@TAB&'<br /><b>'&$threadday&'</b>, <span class="time">'&$threadtime&'</span></span></td>')
$strings = StringSplit($array[$threaddayline-2],'<a href="profile.php?userid=',1)
$strings = StringSplit($strings[2],">",1)
$strings = StringSplit($strings[2],"<",1)
$threadautor = $strings[1]
$strings = StringSplit($string,"<br /><b>",1)
$strings = StringSplit($strings[4],"</b>",1)
$threadlastday = $strings[1]
$strings = StringSplit($string,'<span class="time">',1)
$strings = StringSplit($strings[3],'</span>',1)
$threadlasttime = $strings[1]
$threadlastdayline = _ArraySearch($array,@TAB&'<td class="tablea" align="right"><table border="0" cellspacing="0" cellpadding="1"><tr><td align="right" nowrap="nowrap"><span class="smallfont">')
$strings = StringSplit($array[$threadlastdayline+3],'<a href="profile.php?userid=',1)
$strings = StringSplit($strings[2],"<b>",1)
$strings = StringSplit($strings[2],"<",1)
$threadlastwrite = $strings[1]
If $setdata = 1 Then
GUICtrlSetState($Button,$GUI_ENABLE)
GUICtrlSetData($Input1,$threadtitle)
GUICtrlSetData($Input2,$threadautor)
GUICtrlSetData($Input3,$threadday&" "&$threadtime)
GUICtrlSetData($Input4,$threadlastwrite)
GUICtrlSetData($Input5,$threadlastday&" "&$threadlasttime)
GUICtrlSetTip($Input1,$threadtitle)
Else
Return $threadtitle&"<&-$.6"&$threadlastday&"<&-$.6"&$threadtime&"<&-$.6"&$threadautor&"<&-$.6"&$threadlastwrite&"<&-$.6"&$threadlastday&"<&-$.6"&$threadlasttime
EndIf
EndFunc
Alles anzeigen