coolpdx's profileNanda's spaceBlogGuestbookNetwork Tools Help

Nanda's space

June 02

Auto Blogger

 

Verified few auto blogging solutions, like Auto-Blogger.com, RssToBlog.com and Create Niche Site . Spend more than 3 hrs to make the decision.  RssToBlog.com is the most economical than Auto-Blogger.com.

But the installation seems not that easy.  Worked on some black hat site generation technique. Will follow more soon.

March 29

Migrating the Youtube OLD API to Google GData.

 

As most of sites are using the Youtube  to pull the related video, spent more than 12 hrs to migrate my existing blogs and video web sites to google latest Gdata APIs. 

The Legacy APIs were very compact and send the data only you required. 

But latest GDATA api are very simple and has many features like controlling the output format from atom to RSS.

Youtube Old API
http://www.youtube.com/api2_rest?method=youtube.videos.list_by_tag&dev_id=DEV_ID&tag=monkey&page=1&per_page=50
Google new GDATA API
http://gdata.youtube.com/feeds/api/videos?vq=monkey&start-index=1&max-results=50
Create the WebRequest with the URI you wanted.

// get the data remotely
WebRequest wRequest = WebRequest.Create((string)dataSource);

Load the Response in XPathDocument

wResponse = wRequest.GetResponse();
xpDoc = new XPathDocument(wResponse.GetResponseStream());

That is it,  apply the xPathNavigator to pull the data you needed.

XPathNodeIterator items = xpNav.Select("/rss/channel/item");
XmlNamespaceManager mngr = new XmlNamespaceManager(xpNav.NameTable);
mngr.AddNamespace("media", "
http://search.yahoo.com/mrss/");
mngr.AddNamespace("gd","http://schemas.google.com/g/2005");
mngr.AddNamespace("yt","http://gdata.youtube.com/schemas/2007");

            //mngr.AddNamespace("media", "urn:media");
            XPathExpression titleExpr = xpNav.Compile("string(title/text())");
            XPathExpression descExpr = xpNav.Compile("string(description/text())");
            XPathExpression authorExpr = xpNav.Compile("string(author/text())");
            XPathExpression tagsExpr = xpNav.Compile("string(description/text())");
            XPathExpression urlExpr = xpNav.Compile("string(link/text())");
            XPathExpression thumpnailExpr = xpNav.Compile("string(keywords/text())");

 

with in foreach loop of items, evaluate the values using the xpathexpression defined above.

string title = (string)items.Current.Evaluate(titleExpr);            // <title>
string url = (string)items.Current.Evaluate(urlExpr);            // <link>
string description = (string)items.Current.Evaluate(descExpr);        // <description>

You can see the code in action from Tamil Video

March 10

Asynchronous Web service call & Polling in ASP.NET


Calling the asynchronous webservice method may not be tricky in ASP.NET 2.0.  ASP.NET 2.0 has new page attribute Async="true" and set the AsynBegin Event handler  & AsynEnd event handler of  AddOnPreRenderCompleteAsync method in page load event.

Asynchronous web service call using AddOnPreRenderCompleteAsync

// Register async methods
         AddOnPreRenderCompleteAsync(
             new BeginEventHandler(BeginAsyncOperation),
             new EndEventHandler(EndAsyncOperation)
         );

Or if the Proxy is generated using ASP.NET 2.0 you can attach latest asynchronous delegate  <<Method>>Completed event  with your own implementation. And call the <<Method>>Async.

Asynchronous web service call from ASP.NET

localhost.myservice ws = new localhost.myservice();
ws.LongRunningTaskCompleted += new Poll_testing.localhost.LongRunningTaskCompletedEventHandler(ws_LongRunningTaskCompleted);
          Random rnd = new Random();
          MyState myState = new MyState(ws, Session.SessionID);
          ws.LongRunningTaskAsync(rnd.Next(10000), myState);
          Response.Redirect("poll.aspx", false);

The difference between the above, <<Method>>Async has been handled by system.Threading.SynchronizationContext. New class from asp.net 2.0. MethodAsync flows impersonation, culture, and HttpContext.Current to the MethodCompleted event handler.AddOnPreRenderCompleteAsync does not.

Second, if the page makes multiple asynchronous calls and must delay rendering until all the calls have been completed, using AddOnPreRenderCompleteAsync requires you to compose an IAsyncResult that remains unsignaled until all the calls have completed. With MethodAsync, no such hijinks are necessary; you simply place the calls, as many of them as you like, and the ASP.NET engine delays the rendering phase until the final call returns.

An asychronous page, by contrast, executes as normal through the PreRender event. Then the Begin method that's registered using AddOnPreRenderCompleteAsync is called, after which the request-processing thread goes back to the thread pool. Begin launches an asynchronous I/O operation, and when the operation completes, ASP.NET grabs another thread from the thread pool and calls the End method and executes the remainder of the page's lifecycle on that thread.

 

For more detail ASP.NET Asynchronous programming pattern

But in both cases the PreRenderComplete will not be  called until the <<Method>>Complete or EndEventHandler of AddonPreRenderCompleteAsyn operation.  That means the page will not rendered to the end user till the Asynchronous call complete. 

Say I have an requirement where I need to show progress bar until the process get complete. How can do it? You can check the solution here. But it has sample code only in .NET 1.1. I tried in .net 2.0 doesnt work. getting weird errors.

March 07

Applying MVP Pattern in ASP.NET

 

While reading the MVP and MVC pattern I found this ASP.NET Events tester tool which can test the event delegates and Interfaces.  MVP Pattern is very similar to Fowlers Supervising Controller Pattern.

URL to read about MVP and MVC using ASP.NET

I tried to implement the MVP framework downloaded from http://www.mvcsharp.org but struck with

Failed to access IIS metabase error.

Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.

Will check the resolution later.

February 29

Setting up your Niche Video Site using ASP.NET

 

I just finished coding the Niche Video site Application using ASP.NET. This will allow you organize your videos in a web site.   The main feature of this application is SEO feature. Each page of this Niche Video site is Search Engine optimized for better SERP. Dynamic URLs,  META Description, META Tag, Page Title and Page Header.  Dynamic Site description and more. You can find plenty of PHP solutions but no such ASP.NET niche video  sited builder in the market I can think of . Search yourself to find the Find Niche Video site builder

You can see this ASP.NET niche video site builder software in action by visiting Tamil Videos and SEO Videos.

Tamil videos already getting 100 visitors per day. SEO videos I am still working in adding relevant categories and videos.

I used C# and ASP.NET 2.0 combined with MYSQL database to develop this Niche Video Site builder. The application well designed using MVP design pattern.  I love to setup  your Niche Video site or integrate with your existing ASP.NET web site.  When you setup a niche video site menu, you will be defining a Keyword. That keyword will be used to pull the Videos from YouTube using YouTube API.  Videos and Images are hosted from youtube.com. This asp.net script store only the video category menu information.

ASP-NET-Niche-Video-site-builder

Contact me for the ASP.NET Niche Video Site builder script

 
  • Send a private message
  • Subscribe to RSS feed
  • Tell a friend
  • Add to My MSN
  • Add to Live.com
  • Add to your network
Thanks for visiting!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.