Advertisement
somdcomputerguy

Z:\xampp\htdocs\Rebates\cwrrebates.au3

Dec 16th, 2023 (edited)
1,908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.92 KB | Source Code | 0 0
  1. #cs
  2. acr, 100001
  3. furuno, 100025
  4. garmin, 100026
  5. kvh, 100041
  6. lowrance, 100045
  7. raymarine, 100075
  8. spot, 100122
  9.  
  10. http://www.balmar.net
  11. http://www.bluesea.com/
  12. http://www.comnavmarine.com/
  13. http://www.deimarine.com/
  14. http://www.greenmarinemonitors.com/
  15. http://www.mastervolt.com/
  16. http://www.nobeltec.com/
  17. http://www.rosepointnav.com/
  18. http://www.searecovery.com/marine/
  19. http://www.wxworx.com/
  20.  
  21. http://www.cwrelectronics.com/b2b/product.php?id=
  22. http://cwrelectronics.com/b2b/viewproducts.php?max=30&rebate=1&manufacturer=
  23. http://cwrelectronics.com/feeds/productdownload.php?id=C4&version=2&format=xml&mans=100001,100025,100026,100041,100045,100075,100122&rebate=1
  24. http://cwrelectronics.com/feeds/productdownload.php?id=C4&version=2&format=xml&mans=100001,100025,100026,100041,100045,100075,100122&fields=mfg,ti,litbr,litqg,reb,rebd,rebs,rebe,imgpath&time=1369540800
  25. #ce
  26.  
  27. Opt('MustDeclareVars', 1)
  28. Opt('WinTitleMatchMode', 2)
  29.  
  30. #Region ### START variables ###
  31. Local $ClipVar[3], $OpenFile, $FileName = StringTrimRight(@ScriptName, 4) & ".txt", _
  32.       $ToolTipText_Array[3]  = [" Description ", _
  33.                                 " End Date ", _
  34.                                 " Rebate PDF link "], _
  35.       $HTMLText_Array[4]     = [@MON & "/" & @MDAY & "/" & @YEAR & ", ", _
  36.                                 "<a href='", _
  37.                                 "' title='This link will open a PDF file' target='_blank'>&nbsp;&nbsp;&nbsp;&nbsp;", _
  38.                                 "</a><br />"], _
  39.       $MFG_Array[7]          = [100001,100025,100026,100041,100045,100075,100122], _
  40.       $OtherSites[10]        = ["http://www.balmar.net", _
  41.                                 "http://www.bluesea.com/", _
  42.                                 "http://www.comnavmarine.com/", _
  43.                                 "http://www.deimarine.com/", _
  44.                                 "http://www.greenmarinemonitors.com/", _
  45.                                 "http://www.mastervolt.com/", _
  46.                                 "http://www.nobeltec.com/", _
  47.                                 "http://www.rosepointnav.com/", _
  48.                                 "http://www.searecovery.com/marine/", _
  49.                                 "http://www.wxworx.com/"]
  50. #EndRegion ### END variables ###
  51.  
  52. ;#cs
  53. If MsgBox(262180, StringTrimRight(@ScriptName, 4), "Open CWR Homepage?") = 6 Then
  54.     ShellExecute("http://cwrelectronics.com/")
  55.     Sleep(2500)
  56. EndIf
  57. ;#ce
  58.  
  59. #cs
  60. If MsgBox(262180, StringTrimRight(@ScriptName, 4), "Logged In and Ready To Open the Rebates Pages?") = 6 Then
  61.     For $manid = 0 To UBound($MFG_Array) -1
  62.         ShellExecute("http://cwrelectronics.com/b2b/viewproducts.php?max=30&rebate=1&manufacturer=" & $MFG_Array[$manid])
  63.         Sleep(100)
  64.     Next
  65.     Sleep(2500)
  66. EndIf
  67. #ce
  68.  
  69. If MsgBox(262180, StringTrimRight(@ScriptName, 4), "Logged In and Ready To Open the Rebates Pages?") = 6 Then
  70.     $OpenFile = FileOpen($FileName, 1)
  71.     If $OpenFile = -1 Then
  72.      MsgBox(0, "Error", "Unable to open " & $FileName & ".")
  73.      Exit
  74.     EndIf
  75.     ClipPut("")
  76.     For $manid = 0 To UBound($MFG_Array) - 1
  77.         ShellExecute("http://cwrelectronics.com/b2b/viewproducts.php?max=30&rebate=1&manufacturer=" & $MFG_Array[$manid])
  78.         If MsgBox(262180, StringTrimRight(@ScriptName, 4), "Ready to Copy?") = 6 Then
  79.             While 1
  80.                 For $n = 0 To UBound($ClipVar) - 1
  81.                     While 1
  82.                         Switch $n
  83.                             Case $n
  84.                                 ToolTip($ToolTipText_Array[$n])
  85.                                 If ClipGet() <> "" Then
  86.                                     $ClipVar[$n] = ClipGet()
  87.                                     ExitLoop ; exit from the second While, to the Next $n
  88.                                 EndIf
  89.                         EndSwitch
  90.                         Sleep(100)
  91.                     WEnd
  92.                     ClipPut("")
  93.                 Next
  94.                 ToolTip("")
  95.                 FileWriteLine($OpenFile, $HTMLText_Array[0] & $ClipVar[1] & "," & $HTMLText_Array[1] & $ClipVar[2] & $HTMLText_Array[2] & $ClipVar[0] & $HTMLText_Array[3] & @CRLF)
  96.                 If MsgBox(36, StringTrimRight(@ScriptName, 4), "Do it again?") = 7 Then
  97.                     FileWriteLine($OpenFile, @CRLF & @CRLF)
  98.                     ExitLoop ; exit from the first While
  99.                 EndIf
  100.             WEnd
  101.         EndIf
  102.     Next
  103. EndIf
  104.  
  105.  
  106. #cs
  107. If MsgBox(36, StringTrimRight(@ScriptName, 4), "Open the other sites?") = 6 Then
  108.     For $a = 1 To UBound($OtherSites) - 1
  109.         ShellExecute($OtherSites[$a])
  110.         Sleep(100)
  111.     Next
  112.     Sleep(1500)
  113. EndIf
  114. #ce
  115.  
  116. FileClose($OpenFile)
  117. MsgBox(0, StringTrimRight(@ScriptName, 4), "Bye!", 3)
  118.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement