|
You last visited: Today at 20:22
Advertisement
Aktuellster Firefox Installer Download
Discussion on Aktuellster Firefox Installer Download within the AutoIt forum part of the Coders Den category.
10/17/2013, 21:09
|
#1
|
elite*gold: 0
Join Date: Aug 2013
Posts: 31
Received Thanks: 2
|
Aktuellster Firefox Installer Download
Hi!
Also, meine Funktion gibt den Downloadlink der aktuellsten Firefox Version zurück, klappt auch sehr gut nur dauert es 'relativ' lange und der Code ist auch ziemlich lang. Habe Sie hier gleich mit einer Testausgabe versehen.
Also meine Frage an euch: Jemand eine Idee wie es besser klappt oder/und den Code kürzen?
Code:
$URL = firefoxlink()
MsgBox(64,"Info", $URL)
Func firefoxlink()
$Hilf = "0"
$standard = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/Firefox Setup "
$zweite = "0"
$dritte = "0"
$null = "23"
$version = $null & "." & $zweite & "." & $dritte & ".exe"
$complete = $standard & $version
while InetGetSize($complete) = "0" and $Hilf = "0" ;1
if $zweite = 9 Then ;4
$dritte = 0
$zweite = 0
$null = $null + 1
if InetGetSize($standard & $null & ".0.exe") > 0 then $Hilf = "1"
Else ;4
EndIf ;4
if $dritte = 9 Then ;3
$dritte = 0
$zweite = $zweite + 1
if InetGetSize($standard & $null & "." & $zweite & ".exe") > 0 then $Hilf = "2"
Else ;3
EndIf ;3
$dritte = $dritte + 1
$version = $null & "." & $zweite & "." & $dritte & ".exe"
$complete = $standard & $version
WEnd
;1
if $Hilf = "1" then
$version = $null & "." & "0.exe"
$complete = $standard & $version
EndIf
if $Hilf = "2" then
$version = $null & "." & $zweite & ".exe"
$complete = $standard & $version
EndIf
if InetGetSize($complete) = "0" then ;2
MsgBox(4096, "NICHT VORHANDEN!", "ist nicht da" & " " & $complete)
Else ;2
return $complete
EndIf ;2
EndFunc
Vielen Dank für Die Hilfe im vorraus!
Mit freundlichen Grüßen,
blame
|
|
|
10/17/2013, 21:22
|
#2
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Sehr schön, poste die Fragen in mehreren Foren damit du auch schneller eine Antwort bekommst, die Code-Einrückung ist grausam und lern wie man Arrays verwendet, dann sparst du auch mehr Zeilen.
Es ist vorallem dumm einfach die Versionsnummern durchzuprobieren, stattdessen könntest du per INetGet oder FTP auf die Webseite
Code:
http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/
zugreifen und mittelts
Code:
StringInStr
_StringBetween()
StringRegExp
die Versionsnummer extrahieren, das geht ruckzuck und in weniger als einer Sekunde.
|
|
|
10/17/2013, 22:11
|
#3
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
|
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#include <Clipboard.au3>
$Form1 = GUICreate("Firefox DL", 194, 65, 192, 124)
$genBTN = GUICtrlCreateButton("Generate Link", 8, 32, 83, 25)
$urlTXT = GUICtrlCreateInput("", 8, 8, 177, 21)
$clCHK = GUICtrlCreateCheckbox("Auto Clipboard", 96, 36, 89, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $genBTN
GUICtrlSetData($urlTXT, GenerateLink("de"))
If GUICtrlRead($clCHK) = $GUI_CHECKED Then _ClipBoard_SetData(GUICtrlRead($urlTXT))
EndSwitch
WEnd
Func GenerateLink($language)
$sData = BinaryToString(InetRead("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/" & $language & "/"))
$version = _StringBetween($sData, ">Firefox Setup", "</a>")
$fullLINK = ("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/" & $language & "/Firefox Setup" & $version[0])
Return $fullLINK
EndFunc
This will automatically get a link for the latest Firefox Setup
PS: You can change the language ex: GenerateLink("en-GB") will generate a link for the UK English Version
|
|
|
10/17/2013, 22:56
|
#4
|
elite*gold: 0
Join Date: Aug 2013
Posts: 31
Received Thanks: 2
|
Sorry, das war nicht die Absicht.
Dankeschön, werde ich ausprobieren und hier posten
wow berkay2578, werde ich gleich mal testen
|
|
|
10/18/2013, 00:13
|
#5
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
wie bereits beschrieben lässt sich das ganze simpel als zweizeiler aufbauen:
Code:
Func GetLink()
$link = StringRegExp(BinaryToString(InetRead("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/")), "(Firefox Setup.*?.exe)", 1)
Return "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/"&$link[0]
EndFunc
|
|
|
10/18/2013, 09:04
|
#6
|
elite*gold: 3653
Join Date: Aug 2008
Posts: 30,854
Received Thanks: 529
|
sei alpines ned böse, aber er hat schon recht das multiposting, oder falsche threadnamen machens leuten wie ihm die gern helfen ned unbedingt leichter  ich denke mal die passende antwort hast du ja jetzt
|
|
|
10/18/2013, 10:26
|
#7
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
|
Quote:
Originally Posted by lolkop
wie bereits beschrieben lässt sich das ganze simpel als zweizeiler aufbauen:
Code:
Func GetLink()
$link = StringRegExp(BinaryToString(InetRead("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/")), "(Firefox Setup.*?.exe)", 1)
Return "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/"&$link[0]
EndFunc
|
I wrote it like that so that he could understand how it works.. also you're overloading the regexp, it will not work from time to time.
|
|
|
10/19/2013, 20:28
|
#8
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by berkay2578
I wrote it like that so that he could understand how it works.. also you're overloading the regexp, it will not work from time to time.
|
what is "overloading" of regex? o0
regular expression can allways be used on strings... the only reason for fails might be changes in naming of files or a missing internet connection (which would also cause a crash in your script).
to be 100% sure to not produce a script crash, you could add an "error catching line" like this:
Code:
Func GetLink()
$link = StringRegExp(BinaryToString(InetRead("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/")), "(Firefox Setup.*?.exe)", 1)
If Not IsArray($link) Then Return -1
Return "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/"&$link[0]
EndFunc
|
|
|
10/20/2013, 11:18
|
#9
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
|
Quote:
Originally Posted by lolkop
what is "overloading" of regex? o0
regular expression can allways be used on strings... the only reason for fails might be changes in naming of files or a missing internet connection (which would also cause a crash in your script).
to be 100% sure to not produce a script crash, you could add an "error catching line" like this:
Code:
Func GetLink()
$link = StringRegExp(BinaryToString(InetRead("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/")), "(Firefox Setup.*?.exe)", 1)
If Not IsArray($link) Then Return -1
Return "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/de/"&$link[0]
EndFunc
|
First parameter of the regexp function should be a static string. If you use another function like InetRead for it directly regexp will return 0 from time to time aka overload.
Also, why not just use @SetError?
|
|
|
10/20/2013, 12:43
|
#10
|
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
|
Quote:
Originally Posted by berkay2578
First parameter of the regexp function should be a static string. If you use another function like InetRead for it directly regexp will return 0 from time to time aka overload.
Also, why not just use @SetError?
|
an empty string is just a normal string... there's absolutely no problem with it...
beside that your code:
Quote:
Code:
Func GenerateLink($language)
$sData = BinaryToString(InetRead("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/" & $language & "/"))
$version = _StringBetween($sData, ">Firefox Setup", "</a>")
$fullLINK = ("http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/" & $language & "/Firefox Setup" & $version[0])
Return $fullLINK
EndFunc
|
is EXACTLY the same... it will also use an empty string as input for stringregexp if $sData is empty...
|
|
|
10/20/2013, 14:09
|
#11
|
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,397
|
Quote:
Originally Posted by lolkop
an empty string is just a normal string... there's absolutely no problem with it...
|
This is AutoIT, not a managed language. Just saying..
Quote:
Originally Posted by lolkop
beside that your code:
is EXACTLY the same... it will also use an empty string as input for stringregexp if $sData is empty...
|
Maybe because I wrote that so that he could understand the basics and not deal with miscellaneous stuff?
|
|
|
 |
Similar Threads
|
Firefox Wallhack 800 With New [GG-Emulator Installer]December Idition Wallhack
01/11/2012 - Soldier Front Philippines - 9 Replies
Firefox Wallhack 800 With New December Idition Wallhack Download Now
Screenshot
http://img36.imageshack.us/img36/7674/97293207.jp g
*Removed by Moderator Taec*
STEPS:
|
[Problem] Der Download/Installer
01/06/2011 - WoW Private Server - 1 Replies
Tag,
ich möchte gern auf nem P-Server spielen, war auch schon am downloaden von dem fertigen 3.5.5a Client von UWC.
Doch plötzlich war der Download von der Seite weg :s
Also hab ich mir den Installer geholt und hab gedownloadet, gedownloadet, gedownloadet - Mit 35KB/s :handsdown:
Das ganze hab ich jetzt mal abgebrochen, würde ja Tage dauern.
Wie kann ich am besten WoW downloaden? Normal downloade ich mit 300-400 KB/s. Mit nem Download Manager gehts meist noch ein bisl schneller :D
Lg
|
mozilla firefox installer ??
08/11/2010 - Technical Support - 6 Replies
Da ich den Internet explorer Browser benutze ,
und zur zeit das Problem habe nichts downloaden zu können , kann ich
mir auch nicht den mozilla firefox installer runterladen
( von der Offizielen seite )
Nun bitte ich euch um hilfe .
Könnte jemand nettes den Mozilla firefox installer der nur wenige kb groß ist
auf seiten wie z.b Rapidshare , megaupload hochladen ??
Das würde sicher einen thx geben ;-)
ein VT wäre nicht schlecht dazu ;D
|
S4 Download installer
06/24/2010 - S4 League - 4 Replies
leute habe gerade iwie probleme mit downlaoden vom installer von s4 da bewegt sich iwie garnix.. weis einer was?
|
where to download warcraft v1.2 full installer?
07/19/2007 - World of Warcraft - 1 Replies
do u guys have any idea of a url to where i can download full installer of warcraft v1.2? any info is highly appreciated tnks!!!!
|
All times are GMT +1. The time now is 20:23.
|
|