Jun 30 2008

Common problems faced in Yahoo Pipes

Tag: Web DevelopmentKarthik @ 11:41 am

Why my Yahoo Pipe shows “No Results” on running it?

Yahoo Pipe - No results

Beginners in Yahoo Pipes may end up getting this error message while running their Yahoo Pipes. There are two reasons for a Yahoo Pipe not showing any results.

    The Pipe Output is not wired.
    Make sure that the Pipe Output is wired. Verify the raw output in the debugger.

    Yahoo Pipe - Pipe Output module

    No content element
    Make sure your pipe has an element called “content”, which is required for any HTML based feed output. Output the HTML code of your pipe only to the “content” element. Having your HTML output in any other element will make your pipe output go unrecognized by feed readers.

    Yahoo Pipe - Content element

If your pipe still shows no results, ensure that your pipe sources, i.e. modules like Fetch Page, Fetch Data and Item Builder, pull data needed for the pipe. If you find nothing fishy, debug the pipe starting from “Pipe Output” module and navigating upwards.

Finding it difficult to Regex multi line text?

Simple. Convert it into single line and Regex it. Use a Regex command to replace the new line characters with empty text and apply your Regex commands on the single line text. Do like this,

Yahoo Pipe - Multi line Regex

Noted the option boxes checked in both the commands? Its ‘g’ and ‘m’ for the new line replacement and ‘g’ for remaining commands.

How to add more elements to the feed?

Use the Rename module and copy an existing element. You can remove the source element’s contents by using a Regex module as below.

Yahoo Pipe - Add a new element

Connecting feed output to a string module

Yahoo Pipes doesn’t allow you to wire a port of type “items” to a port of type “string”. But in many cases we require this wiring to process the strings in the feed items. Here is how you should do this…

Add a loop module and place the string module within the loop module. Then connect a module’s “items” output with the loop module. Now the fields in the string module, which is now hosted on the loop module, will be populated with the elements available in the input feed. In the loop module’s field ‘For each’, select the element which has to be processed by the string module. This element in each item of the input feed will be processed by the string module and the string output can either add on to or replace the elements in the input feed, depending on your selection between “assign results” or “emit results”. Here is a sample Pipe that demonstrates Loop module.


Jun 04 2008

அடடே கார்ட்டூன்கள் தளம் மற்றும் ஓடை

தினமணியில் வெளியாகும் அடடே கார்ட்டூன்கள் பற்றி அறிந்திருப்பீர்கள். தினமும் அந்தக் கார்டூன்களை பார்ப்பதற்காக மெனக்கெட்டு தினமணி.com போய் மூன்று நான்கு கிளிக்குகள் செய்து விளம்பரங்களுக்கு மத்தியில் உள்ள கார்ட்டூன்களை ரசிக்கிறீர்களா? இந்த வேலையை எளிதாக்க விரும்புகிறீர்களா? அப்படியென்றால் உங்களுக்கான தளம் http://adade-cartoons.blogspot.com, ஓடை http://feeds.feedburner.com/adade-cartoons.

Yahoo Pipes-ல் இது போன்ற ஓடைகளை எளிதாக உருவாக்கலாம். நான் உருவாகிய இந்த Yahoo Pipe, தினமணி தளத்தில் உள்ள கார்ட்டூன்களை சுரண்டி ஓடையாக மாற்றித் தரும். அந்த ஓடையிலுள்ள கார்ட்டூன்கள் பின்னர் http://adade-cartoons.blogspot.com தளத்தில் பதிவுகளாக வெளிவரும். இதில் கொஞ்சம் manual work-ம் உண்டு. கீழே உள்ள படத்தில் தெளிவாக விளக்கப்பட்டுள்ளது.

Storing history of feed from Yahoo Pipe

Adade Cartoons blog - How it works? - இந்த பதிவில் அடடே கார்ட்டூன்கள் தளத்தின் இயக்கத்தைப் பற்றி விபரமாக எழுதியுள்ளேன்.


May 19 2008

How search engines treat iframes?

Tag: Google Analytics Widgets, Internet, Web DevelopmentKarthik @ 4:45 pm

This question arose in my mind after I designed the embed code of my Google Analytics Widgets based on inline frames. The iframe based design was more comfortable because I could keep the widget’s dimension under my control without depending on the embed code. Rather, I can do anything within the frame’s source page like adding dynamic hyperlinks.

My big mistake here was that I wrongly guessed that search engines treat these hyperlinks as back links as the iframe is embedded on another site. But what I saw was that the search engines treated the links to my page from within iframe tags worser than the nofollow links. I didn’t find any back links in Google Webmaster Central and Yahoo Site explorer. Next, Ravi gave a feedback that iframe in the embed code made him wary.

Finally, I decided to break the embed code into plain HTML without any iframe in it. Now, to the crawler’s view the embedded widget code appears as if it is originating from the same site and the links in the embedded code have now become back links. This also gives an an option to the user to remove the back links, if he/she doesn’t want to add credits to the widget creator.

Compare the two embed codes yourself,

iframe based embed code :
<iframe src='http://www.yemkay.com/apps/SiteAnalytics/GAEmbedImage.aspx?wid=07d59e9b-f1aa-4511-a0a6-b66b4e7a08a6&vars=%26daterange%3d1%26from%3d%26to%3d%26subreport%3d3%26sparkline%3dPageviewsSparkline%26summary%3dPageviewsSummary%26width%3d200%26height%3d200&width=200&height=200'></iframe>

Plain search engine friendly embed code :
<a style='text-decoration : none;' href='http://www.yemkay.com/apps/SiteAnalytics/' target='_blank'><img style='border: 0px none;' alt='Loading…' src='http://www.yemkay.com/apps/SiteAnalytics/HitCounter.aspx?wid=7b2bc7bf-17b1-41c3-968b-6b66499a6f7c&vars=%26subreport%3d3%26summary%3dPageviewsSummary%26since%3d20070101' title='Google Analytics Widgets' title='Hit counter powered by Google Analytics'></img></a>

But I’m yet to find out how search engines treat iframes? Do they index the frame sources as well? And if they do so, do they treat the links on the source pages as back links?


May 09 2008

நான் ஏன் தமிழ்த் தினசரிகளை படிப்பதில்லை?

Tag: தமிழில் (in Tamil), SocialKarthik @ 5:34 pm

சிறு வயதில் தேடித் தேடி படித்தாலும், கொஞ்சம் வெவெரம் வந்த பிறகு இந்த செய்தித்தாள்களை படிப்பதையே விட்டுவிட்டேன். காரணம்,

  • தரமற்ற செய்திகள்.
  • அதிகபடியான விளம்பரங்கள்.
  • எதற்கு முக்கியத்துவம் கொடுக்கவேண்டுமேன்பதே தெரியாது. ரஜினி சம்பந்தப்பட்ட குப்பை செய்தியானாலும் முதலிடம் பிடிக்கும்.
  • கிசு கிசு மற்றும் அனுமானத்தின் அடிப்படையில் வரும் சினிமா மற்றும் விளையாட்டு புள்ளிகளின் காதல், மோதல், கள்ள உறவுகள் பற்றிய செய்திகளுக்கான முக்கியத்துவம்.
    காதலிக்கும் புள்ளிகளை கிசு கிசு மூலம் சேர்த்து வைப்பார்கள். அவர்கள் கல்யாணம் பண்ணிக் கொண்டதும் அவர்களுக்குள் வரும் பிரச்சனைகளை கிசு கிசுவாக்கி விவாகரத்து வாங்கி கொடுப்பார்கள்.
  • அரசியல் சாயத்துடன் வரும் biased news coverage
  • அர்த்தமற்ற கருத்து கணிப்புகள். 312 பேரிடம் கருத்து கேட்டுவிட்டு மொத்த தமிழ்நாட்டுக்கும் project செய்வார்கள்.
  • வெளிநாட்டு செய்திகள் என்று ஒரு பக்கம் இருக்கும். அதில் உலக அளவில் நடத்தப்பட்ட ஆய்வுகளில் முதலிடம் பிடிக்கும் நாடுகளை பற்றி எழுதுவார்கள். உடனே இந்தியா எத்தனையாவது இடம் வந்ததென்று ஆர்வத்துடன் தேடி பார்த்தால் அதில் இருக்காது. ஏனென்றால் அந்த செய்தியை ஒரு வெளிநாட்டு செய்தி நிறுவனத்திடமிருந்து வாங்கி தமிழாக்கம் செய்து வெளியிடுவார்கள். அது நமது ரசனைக்கேற்பவோ எதிர்ப்பார்புக்கேற்பவோ இருக்காது.
  • முக்கிய நிகழ்வுகளில் சில செய்திகளை சடங்கு போல வெளியிடுவார்கள். உதாரணத்திற்கு, +2 ரிசல்ட் அன்று இது தான் தலைப்பு செய்தி - இந்த முறையும் ஆண்களை விட பெண்களே அதிகம் பேர் தேர்ச்சி. (இதை பற்றிய மற்றொருப் பதிவு)
    சட்டபேரவை கூட்டம் நடக்கிறதா? சபையில் ருசிகரம் என்ற தலைப்பில் அமைச்சர் ஒருவர் அடித்த மொக்கை காமடி இருக்கும்.
  • சில செய்திச் சுருக்கங்கள் - அமைச்சர் தனியார் மருத்துவமனையில் அனுமதி, தனியார் ஹோட்டலில் தீ விபத்து, தனியார் பள்ளியில் மாணவிக்கு தலைமுடியை வெட்டிய ஆசிரியை.
    இப்படி வரும் செய்திகளால் யாருக்கு என்ன லாபம்? தனியார் நிறுவங்களின் பெயர்களை நாளிதழ்கள் வெளியிடுவதேயில்லை. ஏனென்றால் ஓசியில் விளம்பரம் செய்தது மாதிரி ஆகி விடுமல்லவா? அப்படியென்றால் இவர்கள் நடத்துவது ஒரு வியாபாரம் தானே? இவர்களை நான்காவது தூண் என்று எப்படி அழைக்க முடியும்?
  • பிற பத்திரிகைகளை மதிப்பதும் இல்லை அவர்களை பற்றிய செய்திகள் இடம் பெறுவதுமில்லை. மாற்றி மாற்றி புழுதியை வாரி இறைத்துக் கொள்வதில் தினமலர், தினகரன் மற்றும் தினத்தந்திக்குள் ஒரு பனிப்போரே நடந்தது.
  • அரசியல் கட்சிகளுக்கு கொள்கைகள் இருப்பது போல நாளிதழ்களுக்கும் சில கொள்கைகள் இருக்கும் (உதாரணத்திற்கு தமிழீழ எதிர்ப்பு). தத்தம் கொள்கைகளை ஒட்டியே அந்த நாளிதழ்களில் வெளிவரும் செய்திகளும் திரிக்கப்படும் அல்லது மறைக்கப்படும். மக்கள் கருத்தை ஒட்டி செய்திகள் இடம் பெறுவதில்லை.

இந்த பதிவை எப்படி முடிப்பதென்று தெரியவில்லை. நல்ல ஊடகம் எப்படி இருக்கும் என்றும் என்னால் வரையறுக்க முடியவில்லை. எனக்கு பிடிக்காத விடயங்களை மட்டும் தொகுத்திருக்கிறேன். இவைகளை தவிர்த்தாலே போதுமானது.


Apr 17 2008

அஜாக்ஸ் முறையில் XML பெறுதல்

முந்தைய பதிவுகள்…
1. அஜாக்ஸ் அறிமுகம்
2. அஜாக்ஸ் முறையில் Plain Text பரிமாற்றம்

சென்ற பதிவில் Plain Text-ஐ எப்படி பெறுவதென்று பார்த்தோம். அதே முறையில் HTML data-வை கூட அஜாக்ஸ் முறையில் பெற்று இணையப் பக்கத்தின் ஒரு பகுதியை மட்டும் refresh செய்யலாம். இந்த இரு முறைகளிலும் நமது javascript நிரலானது வெறும் dump-ஆகத் தான் செயல்படும். Server-லிருந்து என்ன வருகிறதோ அதை அப்படியே இணையப் பக்கத்தில் காட்டும். வந்த தகவல் ஒரு error page-ஆக இருந்தால் கூட நமது நிரலால் கண்டுப்பிடிக்க முடியாது.

நமது நிரலை புதிசாலியாக்க வேண்டுமானால் XML அல்லது JSON (JavaScript Object Notation) data-வால் தான் முடியும். இந்த தகவல்களை பெறுவதும் மிகச் சுலபம். XML response வந்ததும் அதை parser கொண்டு பகுக்க வேண்டும்.

சரி, இப்போது ஒரு எடுத்துக்காட்டு பார்ப்போம். இந்த பதிவிற்காக குழந்தைகளின் பெயர் தேடலுக்கான application ஒன்றை உருவாக்கியுள்ளேன். நிறைய இணையங்கள் இந்த சேவையை வழங்குகின்றன. அந்த இணையங்களில் பெயர்களின் தொகுப்பு alphabetic order-ல் இருக்கும். ஒவ்வொருப் பக்கத்திலும் 100-க்கும் மேற்பட்ட பெயர்கள் இருபதால் அவற்றை மேய்வது சிரமமாக இருக்கும் (ஓர் உதாரணம்)

சரி, இந்த பக்கத்தில் போய் அஜாக்ஸ் முறையில் பெயர் தேடலை பாருங்கள்.
சில ஆங்கில எழுத்துக்களை இட ஆரம்பித்ததும், அவ்வெழுத்துகளில் தொடங்கும் பெயர்களை பட்டியலிட்டுக் காட்டும்.

சரி, இது எப்படி சாதியமாயிற்றென்று பார்ப்போம். முதலில் பெயர்களின் தொகுப்பை XML முறையில் தருவதற்கு ஒரு service தயார் செய்ய வேண்டும். நான் .Net-ல் ஒரு அப்பளிக்கேஷன் செய்து எனது தளத்தில் வைத்துள்ளேன். இந்த service-ன் XML output இப்படி தான் இருக்கும்.
XML output of baby names service

நமது அஜாக்ஸ் நிரல் மூலமாக இந்த service-சிடமிருந்து XML தகவலை கோருவதற்கான நிரல் இதோ இங்கே,

//My web application which returns the list of names in XML format
var service = "http://www.yemkay.com/apps/ajaxseries/ajax-2/";
//Get the letters typed by the user
var keyword = document.getElementById('keyword').value;
//Find the selected baby (boy/girl)
var selBaby = (document.getElementById('boy').checked)? "boy":"girl";
//Construct the url
var url = service + '?q=' + keyword + "&baby=" + selBaby;
//Place an AJAX request
ajax.get(url, gotSuggestions);

ajax என்னும் class-ன் நிரல் நாம் பயன்படுத்தும் library-ல் உள்ளது. (அஜாக்ஸ் Libraryஐ இங்கே தரைஇறக்கவும்). gotSuggestions என்பது ஒரு handler function. நம் கோரலுக்கான response வந்ததும் இந்த function இயங்கும். சரி இப்போது gotSuggestions function-ஐ எப்படி எழுதுவதென்று பார்ப்போம்.

var gotSuggestions=function(text, xml, http_request)
{
	if (http_request.status == 200)
	{
		//Query for all the "baby" elements in the XML
		var babies = xml.getElementsByTagName('baby');
		var index=0, result = "";
		for (index=0; index < babies.length; index++)
		{
			//Add the name and its meaning to the result buffer
			result += babies[index].getAttribute("name");
			result += " - ";
			result += babies[index].getAttribute("meaning");
			result += "<br/>";
		}
		//Show the result in the HTML page
		document.getElementById('suggestph').innerHTML = result;
	}
}

இந்த function-னுடைய “xml” எனும் parameter-ல் நமது XML output இருக்கும். அதை DOM parser மூலம் பகுத்து HTML code-ஐ தயார் செய்ய வேண்டும். அதை ஒரு HTML element-ல் காட்டி விட்டால் வேலை முடிந்தது. ஒரு வேளை நாம் அனுப்பிய எழுத்துகளுக்கு பெயர்கள் எதுவும் இல்லையென்றால் நமக்கு வரும் XML output-ல் baby element ஒன்று கூட இருக்காது. அந்த நேரத்தில் babies.length என்பது zero-வாக இருக்கும்.

இந்த நிரலானது பெயர்கள் எதுவும் இல்லாமல் போனால், “NO RESULTS” என்று காட்டும்.

if (babies==null || babies.length < 1)
{
	result += "No results";
}

முழு நிரலை இங்கே தரை இறக்கவும் (Right click, Save Target As….)


Next Page »


Close
E-mail It