Google Währungsrechner

  • Da ich ab und zu auf Amazon.co.uk einkaufe brauche ich immer den Aktuellen Wechselkurs deshalb habe ich mal ein kleines Script gebastelt was automatisch den
    neusten Kurs ermittelt :)

    Spoiler anzeigen
    [autoit]

    #include <array.au3>
    #include <string.au3>
    #include <inet.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $gui_GoogleKurs = GUICreate("GoogleKurs", 231, 103, 431, 257)
    $kurs_input = GUICtrlCreateCombo("", 8, 8, 97, 25)
    GUICtrlSetData(-1,"GBP|EURO|USD|yen","EURO")
    $kurs_output = GUICtrlCreateCombo("", 128, 8, 97, 25)
    GUICtrlSetData(-1,"GBP|EURO|USD|yen","USD")
    $mony_input = GUICtrlCreateInput("1", 8, 32, 97, 21,BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
    $btn_start = GUICtrlCreateButton("Start", 128, 32, 97, 21, $WS_GROUP)
    $mony_output = GUICtrlCreateLabel("Ergebniss: create by Rodny_le_Lude", 8, 72, 213, 17)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $btn_start

    [/autoit] [autoit][/autoit] [autoit]

    get_kurs(GUICtrlRead($kurs_input),GUICtrlRead($kurs_output),GUICtrlRead($mony_input))
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func get_kurs($k_inp,$k_out,$wert)
    $update="http://www.google.de/search?hl=de&q="&$wert&$k_inp&"+in+"&$k_out&"&aq=f&aqi=&aql=$op=&gs_rfai="
    $read=_INetGetSource($update)
    $str=StringRegExp($read,'138%"[^"]+\</b>',3)
    If IsArray($str) then
    $str=_StringBetween($str[0],"<b>","</b>")
    $str=StringRegExp($str[0],"\d*[,.]*\d+",3)
    GUICtrlSetData($mony_output,"Ergebniss:"&$wert&" "&$k_inp&"="&$str[1]&" "&$k_out)
    Else
    GUICtrlSetData($mony_output,"Ergebniss:kann nicht ermittelt werden")
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
  • danke :D

    update

    Spoiler anzeigen
    [autoit]

    #include <array.au3>
    #include <string.au3>
    #include <inet.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $gui_GoogleKurs = GUICreate("GoogleKurs", 231, 103, 431, 257)
    $kurs_input = GUICtrlCreateCombo("", 8, 8, 97, 25)
    GUICtrlSetData(-1,"GBP|EURO|USD|yen","EURO")
    $kurs_output = GUICtrlCreateCombo("", 128, 8, 97, 25)
    GUICtrlSetData(-1,"GBP|EURO|USD|yen","USD")
    $mony_input = GUICtrlCreateInput("1", 8, 32, 97, 21,BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
    $btn_start = GUICtrlCreateButton("Start", 128, 32, 97, 21, $WS_GROUP)
    $mony_output = GUICtrlCreateLabel("Ergebniss: create by Rodny_le_Lude", 8, 72, 213, 17)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $btn_start

    [/autoit] [autoit][/autoit] [autoit]

    get_kurs(GUICtrlRead($kurs_input),GUICtrlRead($kurs_output),GUICtrlRead($mony_input))
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func get_kurs($k_inp,$k_out,$wert)
    $update="http://www.google.de/search?hl=de&q="&$wert&$k_inp&"+in+"&$k_out&"&aq=f&aqi=&aql=$op=&gs_rfai="
    $read=_INetGetSource($update)
    $str=StringRegExp($read,'138%"[^"]+\</b>',3)
    If IsArray($str) then
    $str=_StringBetween($str[0],"<b>","</b>")
    GUICtrlSetData($mony_output,"Ergebniss:"&$str[0])
    Else
    GUICtrlSetData($mony_output,"Ergebniss:kann nicht ermittelt werden")
    EndIf
    EndFunc

    [/autoit]
  • Es heißt Ergebnis nicht Ergebniss^^


    Ja ja , ich bin keine grosse Leuchte in der "die :D " Grammatik :wacko: :thumbup:
    Ah ja ?( Update das letzte

    Spoiler anzeigen
    [autoit]

    #include <array.au3>
    #include <string.au3>
    #include <inet.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $gui_GoogleKurs = GUICreate("GoogleKurs", 500, 103, 431, 257)
    $kurs_input = GUICtrlCreateCombo("", 8, 8, 97, 25)
    GUICtrlSetData(-1,"GBP|EURO|USD|yen","EURO")
    $kurs_output = GUICtrlCreateCombo("", 128, 8, 97, 25)
    GUICtrlSetData(-1,"GBP|EURO|USD|yen","USD")
    $mony_input = GUICtrlCreateInput("1", 8, 32, 97, 21,BitOR($ES_AUTOHSCROLL,$ES_NUMBER))
    $btn_start = GUICtrlCreateButton("Start", 128, 32, 97, 21, $WS_GROUP)
    $mony_output = GUICtrlCreateLabel("Ergebnis: create by Rodny_le_Lude", 8, 72, 480, 17)
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $btn_start

    [/autoit] [autoit][/autoit] [autoit]

    get_kurs(GUICtrlRead($kurs_input),GUICtrlRead($kurs_output),GUICtrlRead($mony_input))
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func get_kurs($k_inp,$k_out,$wert)
    $update="http://www.google.de/search?hl=de&q="&$wert&$k_inp&"+in+"&$k_out&"&aq=f&aqi=&aql=$op=&gs_rfai="
    $read=_INetGetSource($update)
    $str=StringRegExp($read,'138%"[^"]+\</b>',3)
    If IsArray($str) then
    $str=_StringBetween($str[0],"<b>","</b>")
    _ArrayDisplay($str)
    GUICtrlSetData($mony_output,"Ergebniss:"&$str[0])
    Else
    GUICtrlSetData($mony_output,"Ergebnis:kann nicht ermittelt werden")
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]