PoshCode Archive  Artifact [8c7f1f2c00]

Artifact 8c7f1f2c00812db901229a2e280382eb9aae053a701ffa1591f9c4a8aa27bcce:

  • File Get-Twitter-RSS-Feed.ps1 — part of check-in [0d9897862e] at 2018-06-10 13:15:07 on branch trunk — This script will take a Twitter User’s Screen name and get their RSS feed of posts (user: CrazyDave size: 903)

# encoding: ascii
# api: powershell
# title: Get Twitter RSS Feed
# description: This script will take a Twitter User’s Screen name and get their RSS feed of posts
# version: 0.1
# author: CrazyDave
# license: CC0
# x-poshcode-id: 2739
# x-archived: 2014-04-11T01:00:26
# x-published: 2014-06-18T13:11:00
#
#
param ([String] $ScreenName)

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

$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