Code for node-webfinger is here on github.
The project contains a simple webfinger-buzz.js command line app that demonstrates the webfinger client. It uses webfinger to find a google buzz feed based on a gmail address, then fetches the updates as an Atom feed, and then prints out the latest entry from that feed.
This could be generalized to support any other webfinger-enabled site like yahoo (though it looks like they're using an older version of XRD which my code can't parse :/).
The webfinger-buzz.js client looks something like this:
var sys = require('sys'), http = require("http"), url = require("url"), atom = require("./lib/atom"), webfinger = require('./lib/webfinger-client'); if (process.argv.length < 3) { sys.puts("usage: " + process.argv[0] + " " + process.argv[1] + " <user uri>"); process.exit(); } var userUri = process.argv[2]; sys.puts("fingering " + userUri); var wf = new webfinger.WebFingerClient(); var fingerPromise = wf.finger(userUri); fingerPromise.addCallback(function(xrdObj) { var statusLinks = xrdObj.getLinksByRel("http://schemas.google.com/g/2010#updates-from"); var statusUrl = url.parse(statusLinks[0].getAttrValues('href')[0]); var httpClient = http.createClient(80, statusUrl.hostname); var path = statusUrl.pathname; if (statusUrl.search) { path += statusUrl.search; } var request = httpClient.request("GET", path, {"host": statusUrl.hostname}); request.addListener('response', function (response) { response.setBodyEncoding("utf8"); var body = ""; response.addListener("data", function (chunk) { body += chunk; }); response.addListener("end", function() { var atomParser = new atom.AtomParser(false); var atomPromise = atomParser.parse(body); atomPromise.addCallback(function(atomFeed) { sys.puts("Feed: " + atomFeed.title); sys.puts(atomFeed.entries.length + " entries"); sys.puts("Updated: " + atomFeed.entries[0].updated); sys.puts(atomFeed.entries[0].title + ": " + atomFeed.entries[0].summary); }); }); }); request.close(); });
hehe fingerPromise. Is that a generalization of pinkySwear?
In the process of writing this webfinger client I used a couple of libraries I found on teh internets: sax-js by Isaac Z. Schlueter - a SAX parser for nodejs, and this URI Template library by James Snell. Both worked well and I recommend them.
The remaining non-webfinger-specific pieces I needed were an XRD parser and an Atom parser, both for javascript and SAX (as opposed to DOM). I couldn't find much in the way of those, so I rolled my own. They are included in the node-webfinger project in the lib/ directory. They're pretty crude parsers but they worked for this example. I'll probably use them in other projects in the future and make improvements as necessary. Unless something better comes along. That seems inevitable.
AngularJS Training in Chennai AngularJS Training in Chennai Node.js Training in CHennai Angular 2 Training in Chennai Angular 2 Training in Chennai Node.js Training in CHennai Node.js Training in chennai MEAN Developer Training in Chennai
ReplyDeleteBackBoneJS Training in Chennai BackBoneJS Training in Chennai EmberJS Training in Chennai EmberJS Training in Chennai
Webfinger is a protocol used to discover information about people or other entities on the web, often used in conjunction with federated services like ActivityPub. Implementing a Webfinger client in Node.js allows you to retrieve such information for given resources (typically email addresses or URLs).
DeleteFinal Year Project Centers in Chennai
IEEE projects for cse
major project for cse final year
discount oakley sunglasses
ReplyDeleteugg boots
moncler outlet online
pandora charms
longchamp sale
nike blazer low pas cher
michael kors outlet online
jimmy choo shoes
hejixia20161202
ReplyDeleteHi there to all, for the reason that I am in fact keen of reading this weblog's post to be updated on a regular basis. It contains good data. capitalone.com login
Wow i really liked your blog. Thanks to the author of this blog for sharing this awesome post with us.
ReplyDeleteSpoken English Class in Anna Nagar
Spoken English Classes in Chennai Anna Nagar
Spoken English Classes in Anna Nagar West
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
Spoken English Class in Chennai
Spoken English in Chennai
English Classes in Chennai
I feel satisfied to read your blog, you have been delivering a useful & unique information to our vision.keep blogging.
ReplyDeleteRegards,
microsoft dynamics crm training institutes in chennai
microsoft dynamics training
Ethical Hacking Course in Chennai
PHP Training in Chennai
ccna course in Chennai
Web Designing Course in Chennai
I have read your blog and I gathered some needful information from your blog. Keep update your blog. Awaiting for your next update. Thanks
ReplyDeleteDedicatedHosting4u.com
Good Article!!!!
ReplyDeleteweb designing and development course training institute in Chennai with placement
PHP MySQL programming developer course training institute in chennai with placement
Magento 2 Developer course training institute in chennai
A IEEE project is an interrelated arrangement of exercises, having a positive beginning and end point and bringing about an interesting result in Engineering Colleges for a particular asset assignment working under a triple limitation - time, cost and execution. Final Year Project Domains for CSE In Engineering Colleges, final year IEEE Project Management requires the utilization of abilities and information to arrange, plan, plan, direct, control, screen, and assess a final year project for cse. The utilization of Project Management to accomplish authoritative objectives has expanded quickly and many engineering colleges have reacted with final year IEEE projects Project Centers in Chennai for CSE to help students in learning these remarkable abilities.
ReplyDeleteSpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai
Nice blog was really feeling good to read it. Thanks for this information.
ReplyDeleteSpoken English Classes in Chennai
English Speaking Course in Chennai
french classes
pearson vue test center in chennai
IoT Training in Chennai
spoken english course in chennai
Xamarin Training in Chennai
Node JS Training in Chennai
spanish language in chennai
content writing training in chennai
Spoken English Classes in OMR
Spoken English Classes in Porur
Đặt vé máy bay tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ bao nhiêu tiền
vé máy bay hà nội đi sài gòn
vé cần thơ đi hà nội
đặt vé máy bay đi nha trang
giá vé máy bay đi đà lạt khứ hồi
taxi sân bay hà nội nội bài
combo hải phòng nha trang
Great insights on Webfinger for Node.js! Integrating tools like this can streamline user identity and data sharing across platforms, which is so useful in Web Design and Development. It’s interesting to see how these protocols can enhance the functionality and security of modern web applications.
ReplyDelete