Using PowerShell to Archive Twitter Feeds–Preserving the wisdom of Paul Randal

You may also like...

2 Responses

  1. Chad Miller says:

    Take a look at export-csv. You can then use Invoke-sqlcmd or just plain old sqlcmd/osql to run a BULK INSERT statement to import the csv:
    ([xml] (new-object net.webclient).DownloadString(“”)) | Select description, pubDate, link | Export-Csv -NoTypeInformation ./randal.csv

    Another option is to build up a batch of insert statements and then call invoke-sqlcmd/sqlcmd:

    $sql = ([xml] (new-object net.webclient).DownloadString(“”)) | foreach { “INSERT twitter_feeds VALUES (‘$($_.description)’,’$($_.pubDate)’, ‘$($’)”}

    There’s a few other options listed here:

  2. Max Trinidad says:

    To eliminate the truncate description you need to remove the “FT” line and save the result to a variable, then use Get-member to see all the Properties available to you. Then, with some more PowerShell code you could move the data around and put it somewhere else…maybe a SQL table.

    One thing for sure… once you start using PowerShell, there’s no stop!

Leave a Reply to Chad Miller Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: