Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 20:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Aktuellster Firefox Installer Download

Discussion on Aktuellster Firefox Installer Download within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 31
Received Thanks: 2
Lightbulb 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?

Vielen Dank für Die Hilfe im vorraus!

Mit freundlichen Grüßen,
blame
only_blame is offline  
Old 10/17/2013, 21:22   #2
 
alpines's Avatar
 
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.
alpines is offline  
Thanks
1 User
Old 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
berkay2578 is offline  
Old 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
only_blame is offline  
Old 10/18/2013, 00:13   #5
 
lolkop's Avatar
 
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
lolkop is offline  
Old 10/18/2013, 09:04   #6
 
c0w's Avatar
 
elite*gold: 3653
The Black Market: 378/0/0
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
c0w is offline  
Old 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 View Post
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.
berkay2578 is offline  
Old 10/19/2013, 20:28   #8
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
Quote:
Originally Posted by berkay2578 View Post
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
lolkop is offline  
Old 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 View Post
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?
berkay2578 is offline  
Old 10/20/2013, 12:43   #10
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
Quote:
Originally Posted by berkay2578 View Post
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...
lolkop is offline  
Old 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 View Post
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 View Post
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?
berkay2578 is offline  
Reply

Tags
autoit, download, firefox, installer, update


Similar Threads 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.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.