PoshCode Logo PowerShell Code Repository

Difference between
modified post 6775 by mrbouwbedrijf on Wed 8th Mar 08:55 and
original post 6771 by ZioNLight1 on Sat 4th Mar 23:25
Showold version | new version | both versions

    
11
param ([String] $ScreenName)
33
$client = New-Object System.Net.WebClient
44
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=$ScreenName"
55
$data = $client.DownloadString($idUrl)
77
$start = 0
99
$findStr = '"id":'
1010
do {
1111
    $start = $data.IndexOf($findStr, $start + 1)
1212
    if ($start -gt 0) {
1313
        $start += $findStr.Length
1414
        $end = $data.IndexOf(',', $start)
1515
        $userId = $data.SubString($start, $end-$start)
1616
    }
1717
} while ($start -le $data.Length -and $start -gt 0)
1919
$feed = "http://twitter.com/statuses/user_timeline/$userId.rss"
2121
$feed

ContributeMost Recent Contributions (feed)

Contribute ... Next Page