| Abhishek Agrawa...'s profileAbhishek's PowerShell Bl...BlogLists | Help |
|
Abhishek's PowerShell BlogFebruary 17 Sometimes it feels like 2001... Vista is out in the market, web 2.0 is the craze, cars can parallel park themselves... surely it is 2007. But every so often certain tech activities take you back to another era. Last night I had 2 such experiences.
I was at a friend's place and needed to setup my laptop to access his wireless network. A simple scenario which required 3 manual steps. a) The friend had to dig up the zillion character network key and narrate it to me b) Login into his router and add my MAC address to the allowed list c) I had to manually enter the network key on my machine and wait for the magic to happen. I mistyped the network key once, my friend mistyped my MAC address once, the whole operation took 3 attempts and about 10 mins. Should'nt this be simple?
Once I got internet access on my laptop, I logged onto www.willow.tv to watch the live internet broadcast of India vs Sri Lanka cricket match. (willow.tv is proof that internet is the future of TV content) The content had to be projected on to the TV so we ended up using a S-video cable to hook-up the laptop to the TV. A fine solution, except that the game of cricket lasts six hours which meant that my laptop was unusable for any other interactive computing activity for that period. Should'nt I be able to direct a live internet stream to my TV today?
Now, I know a couple of different better solutions for the above 2 scenarios. The point is the solutions should have been commonplace already. January 14 Exit SeahawksSeahawks run finally ended today at chicago, but not before they put up a good fight. Actually, with a little bit of luck they could have won it. Anyways, it was tough season with injuries and all, BOL for next year.
Next on the sporting agenda is the cricket world cup. Chopping and changes going on in the indian cricket team. Wierd what can happen in a year. Ganguly was a relic last year who no one wanted to touch. Today he is the "experienced campaigner" the team wants to rally around. January 09 out-flickrNow that the holiday season is over, many folks would have a gazzillion photos to arrange, organize, upload and share. I am a flickr user and I use it to share photos with friends and family. To make my life easy I wrote a PowerShell script to upload photos to my flickr account.
This is how the usage looks like
PS> cd c:\pictures\New_Year
PS> ls *.jpg | out-flickr
You will now be redirected to www.flickr.com to complete authentication. Hit Ent
er when authentication is complete:: uploading C:\Pictures\New_Year\abhishek.jpg... upload successful, photoid: 352538696 uploading C:\Pictures\New_Year\tanks.jpg... upload successful, photoid: 352538762 uploading C:\Pictures\New_Year\rock1.JPG... upload successful, photoid: 352538784 PS> The script is built on top of the FlickrNet api library which provides an easy way to access the flickr web service from .Net. To use the script the dll needs to be downloaded and loaded into your powershell session. This MSDN Article is a good reference on how to use the library.
To use the script you will need to register for a Flickr API key. A shared secret will also be created at regsitration time (register as a desktop application). The script listing is shown at the end of this article. Enter your flickr key and flickr secret to get the script working.
This is how the script works: The first step is to authenticate the powershell session with the Flickr service. The script will redirect the user to the flickr web-page in your browser, ask them to login and grant permission to the powershell script to access their photos. Once authentication completes, the user returns to the powershell session and hits enter to continue. The script will cache the Authentication token in the powershell session, so the user will not need to authenticate every time.
The core of the script is to call UploadPicture api and pass it the filename to upload. All photos are marked private by default. Rest of the script is just plumbing to make the piping of fileinfo objects into the script work. Once the photos have been uploaded the user is redirected to flickr again to allow them to edit properties on newly uploaded pics.
#out-flickr.ps1
#Note the script assumes the FlickrNet assembly has been loaded into the powershell session
#Error-handling is weak and there might be bugs :-)
January 05 Cricket PowerGadgetHappy new year all!
The powershell community has been doing tons of fun stuff with powershell lately. This guy made a Alarm clock using Itunes and powershell, very cool!
But it is cricket season and so my current favorite has to be the Cricket PowerGadget script by Rob Farley to get Ashes scores. (btw congratulations to the Aussies for a 5-0 rout). The script pulls data from cricinfo and feeds it to a powergadget. I am using a modified version to get scores for India-South Africa series. As I write this, Dada and "the wall" are battling it out in the middle. Looking forward to the first series win in SA. Go dada! |
|
||||
|
|