
{"id":1302,"date":"2008-10-25T14:47:32","date_gmt":"2008-10-25T21:47:32","guid":{"rendered":"http:\/\/briantroy.com\/blog\/2008\/10\/25\/friendfeed-to-xmpp-bridge-why-how-and-the-plan\/"},"modified":"2008-10-25T14:47:32","modified_gmt":"2008-10-25T21:47:32","slug":"friendfeed-to-xmpp-bridge-why-how-and-the-plan","status":"publish","type":"post","link":"https:\/\/blogarchive.briantroy.com\/index.php\/2008\/10\/25\/friendfeed-to-xmpp-bridge-why-how-and-the-plan\/","title":{"rendered":"FriendFeed to XMPP Bridge &#8211; Why, how and the plan."},"content":{"rendered":"<p>Yesterday I took about and hour and created a <a href=\"http:\/\/www.friendfeed.com\">FriendFeed<\/a> to XMPP bridge. The advantage I had was that I was already running a XMPP server and had a working XMPP bot &#8211; these existed for my own personal use as well as for <a title=\"cosinity - communications applications that deliver\" href=\"http:\/\/www.cosinity.com\">cosinity<\/a>.<\/p>\n<p>Why?<\/p>\n<p>Primarily this is about information discovery. The ability to participate is challenging (see below) as FriendFeed is an aggregator.<\/p>\n<p>As I said in an <a href=\"http:\/\/briantroy.com\/blog\/2008\/10\/21\/social-media-is-about-aggregation-not-publishingnetworks\/\">earlier post<\/a> &#8211; I believe FriendFeed&#8217;s Real-Time functionality is missing two important capabilities.<\/p>\n<ol>\n<li>The ability to filter the feed by keyword(s).<\/li>\n<li>The ability to get real-time for the public timeline.<\/li>\n<\/ol>\n<p>While there is nothing I can do about access to the public timeline &#8211; I can, via the API, create the ability to filter a feed by keyword(s).<\/p>\n<p>Additionally, XMPP is a clean way to distribute the information &#8211; so why not have it published via XMPP?<\/p>\n<p>How?<\/p>\n<p>Since FriendFeed had not released any sample code or a Python\/PHP library for real-time yet I had to modify the existing libraries to support real time. This turned out to be trivial &#8211; I simply made a new {fetch_RT} function which looks much like the existing {fetch} function. With that complete I could simply use this modified PHP library to grab a user&#8217;s real-time stream.<\/p>\n<p>As I mentioned earlier I already had an XMPP server running and had created a bot for other reasons. I simply re-used that bot and the over the network XML API defined by the bot to send the FriendFeed stream out as XMPP messages.<\/p>\n<p>There are several important things to note here about the architecture:<\/p>\n<ol>\n<li>De-Coupling the FriendFeed real-time processes from the XMPP bot processes is a very efficient model.<\/li>\n<li>Keeping the XMPP stream bot a &#8220;dumb pipe&#8221; (i.e., outbound message streaming only) is also very efficient.\n<ol>\n<li>Clicking on the link at the front of the XMPP message opens the FriendFeed &#8220;conversation&#8221; in a browser.<\/li>\n<\/ol>\n<\/li>\n<li>Since FriendFeed is an aggregator, participation via XMPP will be very problematic.\n<ol>\n<li>For Example: If the message is a tweet do you want to reply with a tweet &#8211; or comment on the tweet in FriendFeed&#8217;s conversation?<\/li>\n<li>The bot would have to track a large number of variables for each message in order to properly distribute your comment\/message\/etc.<\/li>\n<li>This overhead would directly affect the ability of the service to scale.<\/li>\n<\/ol>\n<\/li>\n<li>The scope of the feed (e.g., the apple room or My Home feed or my &#8220;the cool people list&#8221;) and the keywords for which you&#8217;d like an XMPP notification would be configured via a web interface.\n<ol>\n<li>This &#8211; again &#8211; goes directly to keeping the service as scalable as possible.<\/li>\n<li>The down side is you can&#8217;t change scope or keywords via XMPP messages.<\/li>\n<li>There is the possibility of creating a separate &#8220;ffstreamcontrol&#8221; bot which would take these commands. It remains to seen if this is really required or a nice to have.<\/li>\n<\/ol>\n<\/li>\n<li>Since the stream bot acts as a dumb pipe &#8211; it can rapidly scale by running multiple instances with the same UID and a different resource string. You won&#8217;t know (or care) which bot you are connected to &#8211; they all look the same. If one dies &#8211; the FriendFeed real-time processes will be programed to try the next one&#8230; and the next one&#8230; etc.\n<ol>\n<li>Again &#8211; this is a very efficient model.<\/li>\n<li>Will provide high levels of redundancy<\/li>\n<\/ol>\n<\/li>\n<li>The bots will all connect to a dedicated XMPP server &#8211; the XMPP messages will then be distributed via XMPP federation.\n<ol>\n<li>XMPP federation protocols are very efficient.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>The Plan:<\/p>\n<p>My current plan is to build something similar to what you see below. The user will create XMPP streams based on scope (i.e., FriendFeed scope &#8211; For Example: the Debates 2008 room) and keyword(s). The user will be allowed multiple XMPP streams. All XMPP stream creation, deletion and modification will be done via a web interface.<\/p>\n<p>The XMPP bot(s) will serve as a dumb pipe for content delivery.<\/p>\n<p>Participation is problematic &#8211; and as such will be set aside for now. User&#8217;s can still participate by clicking on the link in the XMPP message &#8211; this link will open the FriendFeed conversation (<a href=\"http:\/\/friendfeed.com\/e\/21498110-175d-4364-983e-842c9d418b07\">here is one for example<\/a>). This will allow the user to participate, subscribe to the user&#8217;s involved in the conversation, etc.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/briantroy.com\/wp-content\/uploads\/2008\/10\/ff.jpg\" alt=\"ff.tiff\" width=\"480\" height=\"390\" \/><\/p>\n<p>Please feel free to comment &#8211; let me know if you think this is headed in the right direction.<br \/>\nNOTE: This was written very quickly based on a prototype made yesterday. Please excuse any less than completely thought through concepts&#8230; it is a work in progress.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I took about and hour and created a FriendFeed to XMPP bridge. The advantage I had was that I was already running a XMPP server and had a working XMPP bot &#8211; these existed for my own personal use as well as for cosinity. Why? Primarily this is about information discovery. The ability to&hellip; <a class=\"more-link\" href=\"https:\/\/blogarchive.briantroy.com\/index.php\/2008\/10\/25\/friendfeed-to-xmpp-bridge-why-how-and-the-plan\/\">Continue reading <span class=\"screen-reader-text\">FriendFeed to XMPP Bridge &#8211; Why, how and the plan.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,12],"tags":[78,135,158,258],"_links":{"self":[{"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/posts\/1302"}],"collection":[{"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/comments?post=1302"}],"version-history":[{"count":0,"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/posts\/1302\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/media?parent=1302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/categories?post=1302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogarchive.briantroy.com\/index.php\/wp-json\/wp\/v2\/tags?post=1302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}