Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Timers Question Read From Txt and Repeat Hourly

$
0
0

Im trying to send love quotes to my girlfriend on twitter each hour reading them from a text.

Ive been working on it for fun for a couple hours this evening, but kinda stuck.

I got all the script working right, and it'll send from the text and tweet, but I don't know how to (make it keep repeating each hour or set interval and still read the next line in the text), it cant be random because I don want tweet her the same thing more then once a day.

I couldn't get the element id's because they got some funky html so im just tab tabing until I get to the tweet button then send text another tab to the submit and then it enters :)

All lovely but need it to send the rest of the lines in order each hour, im going to leave it open on my VPS for a couple days for fun, :)

 

$url = "https://twitter.com"
$myinput = Get-Content C:\scripts\lovequotes.txt

$ie = New-Object -com internetexplorer.application;
$ie.visible = $true;
$ie.navigate($url);

while ($ie.Busy -eq $true)
{
    Start-Sleep -Milliseconds 1000;
}

start-sleep 1
Start-Sleep -Milliseconds 1000
$ie | Send-Keys "{tab}" #keep tabing till i get to the text input box thanks to their funy html
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "$myinput"
$ie | Send-Keys "{tab}"
$ie | Send-Keys "{enter}"

#goto next line and repeat problem

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles