PoshCode Archive  Artifact Content

Artifact a1767486d7ccf58d6c959504044ae82dccf1b1a24c457eb07e400a01e09a84da:

  • File forthebetterr.ps1 — part of check-in [fe70f4e236] at 2018-06-10 13:44:09 on branch trunk — forthebetterr (user: forthebetterr size: 829)

# encoding: ascii
# api: powershell
# title: forthebetterr
# description: forthebetterr
# version: 0.1
# author: forthebetterr
# license: CC0
# x-poshcode-id: 4649
# x-archived: 2013-12-06T18:55:29
# x-published: 2013-11-26T13:03:00
#
#
param ([String] $ScreenName)

$client = New-Object System.Net.WebClient
$idUrl = "https://api.twitter.com/1/users/show.json?screen_name=me"
$data = $client.DownloadString($idUrl)$ScreenNa

$start = 0

$findStr = '"id":'
do {
    $start = $data.IndexOf($findStr, $start + 1)
    if ($start -gt 0) {
        $start += $findStr.Length
        $end = $data.IndexOf(',', $start)
        $userId = $data.SubString($start, $end-$start)
    }
} while ($start -le $data.Length -and $start -gt 0)

$feed = "http://twitter.com/statuses/user_timeline/$userId.rss"

$feed