PoshCode Archive  Artifact [333ee270f9]

Artifact 333ee270f9d2e6f5bc09431ba4f6a126d73f04f381d64e92ee85d73c8dd95506:

  • File Get-Twitter-RSS-Feed.ps1 — part of check-in [77121aec04] at 2018-06-10 13:17:54 on branch trunk — This script will take a Twitter User’s Screen name and get their RSS feed of posts (user: Charlie size: 901)

# 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: Charlie
# license: CC0
# x-poshcode-id: 2971
# x-archived: 2012-12-29T05:42:40
# x-published: 2012-09-26T14:18: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