To start with, I have following images available in my Picasa web album "SSIS-Image-Test". We will download these images to our local folder.
Before we get our hand to SSIS we need to ensure that we have Google account, internet connectivity and we have installed the Google Data API client library for .NET.
In SSIS package at control flow; I have one component Script Task. Script task contains the .NET code logic to download the images from Picasa web album.
- SSIS: Read public data of Twitter Users?
- SSIS: How to pull Tweets from Twitter?
- SSIS: How to pull Currency Rates from European Central Bank
- SSIS: How to pull Stock Quotes from Google Finance
- SSIS: How to load data into SQL table from Google Spreadsheet?
- SSIS: How to Load images into Picasa web album?
I have added references of Google Data API DLLs and using following name space in the script task.
using Google.GData.Client; using Google.GData.Photos; using Google.GData.Extensions; using Google.GData.Extensions.Location; using Google.Picasa; using System.Net;
The .NET code snippet for Main function() in Script Task is following:
public void Main() { string filename; //Download all images to this path. filename="C:\\006. Temp\\Image\\SSISImage\\DownloadImage\\"; PicasaService myPicasa = new PicasaService("Vikash-Test-Picasa"); //Pass userid and password as the credentials myPicasa.setUserCredentials("abc@gmail.com", "abcpassword"); PhotoQuery myPhotoQuery = new PhotoQuery(PicasaQuery.CreatePicasaUri("abc", "5746268939336053009")); PicasaFeed myPicasaFeed = myPicasa.Query(myPhotoQuery); foreach (PicasaEntry p in myPicasaFeed.Entries) { //Create the Webclient and download file WebClient wc = new WebClient(); wc.DownloadFile(p.Content.Src.ToString(),filename + p.Title.Text); Dts.TaskResult = (int)ScriptResults.Success; }
After setting up the code, I run the package and package completed successfully.
I checked my local folder and all images were successfully downloaded into folder.
So our objective to download images from Picasa web album is achived.
Thanks for reading this post
If you wan to explore more on Picasa with .NET; please visit Google API Series in .NET
- SSIS: Read public data of Twitter Users?
- SSIS: How to pull Currency Rates from European Central Bank
- SSIS: How to pull Tweets from Twitter?
- SSIS: How to read Excel Meta Data?
- SSIS: How to resolve Excel Import 255 character Truncation issue?
- SSIS: Read and Export Excel data from nth Row
- SSIS: How to pull Stock Quotes from Google Finance
- SSIS: How to load data into SQL table from Google Spreadsheet?
- SSIS: How to Download images from Picasa album?
- SSIS: How to Load images into Picasa web album?
- SSIS: How to Load XML search result from Search engines like Bing, Google etc?
- SSIS: How to generate HyperLink in Excel output?
- SSIS: How to Compress/Zip your file using 7-Zip?
- SSIS: What is CheckPoints?
- SSIS: Checkpoints implementation
- SSIS: Event Handlers
- SSIS: Data Flow v/s Control Flow