Jump to content

Upload to Screenly


SnArF
 Share

Recommended Posts

Hello,

I'm using a raspberry PI with screenly.

I have to upload 1000+ files and want to automate it but I can't figure out how.

Please help, These are the step I need, 

1.Open the site (see http://ose.demo.screenlyapp.com/ )
2. Click Ad asset
3. Click Upload and thnb click choose file
4. set time and date
5. save

This is what i have so far

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("http://ose.demo.screenlyapp.com/")
_IELoadWait($oIE)

Local $oDiv = _IEGetObjById($oIE, "add-asset-button")
_IEAction($oDiv, "click")

 

My scripts: _ConsoleWriteLog | _FileArray2D

 

 

 

Link to comment
Share on other sites

my first script with ie.au3 
#pragma compile(AutoItExecuteAllowed, True)

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $Filepathtosend = @ScriptFullPath

If StringInStr($CmdLineRaw, "[filetosend]") > 0 Then
    $Filepathtosend = StringSplit($CmdLineRaw, "[filetosend]", 1)
    If @error Then Exit
    Local $hWnd = WinWait("[CLASS:#32770]", "", 1000)
    WinActivate($hWnd)
    WinWaitActive($hWnd)
    Sleep(500)
    Send($Filepathtosend[2] & "{TAB}{ENTER}")
    Exit
EndIf

Local $oIE = _IECreate("http://ose.demo.screenlyapp.com/")
_IELoadWait($oIE)

Local $oDiv = _IEGetObjById($oIE, "add-asset-button")
_IEAction($oDiv, "click")
_IELoadWait($oIE)
Sleep(1000)
_IELinkClickByText($oIE, "Upload")
Local $oDiv = _IEGetObjByName($oIE, "file_upload")
ShellExecute(@AutoItExe, " /AutoIt3ExecuteScript " & FileGetShortName(@ScriptFullPath) & " [filetosend]" & $Filepathtosend)
_IEAction($oDiv, "click")

$oLinks = _IETagNameGetCollection($oIE, "input")
For $oLink In $oLinks
    If String($oLink.type) = "submit" And String($oLink.value) = "Save" Then
          _IEAction($oLink, "click")
          ExitLoop
    EndIf
Next

 

Edited by Celtic88
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...