Category: Interesting Links

Here comes Postman, the tiny little app that connects Flickr and Facebook Groups together

Postman Flickr to Facebook Groups photo sharing service

We were working to develop a new utility web application for last couple of days which will help us, the photographers, to easily share photos from our flickr photostream to multiple Facebook groups that we are subscribed to. There was a reason why we wanted to develop this app in the first place. Every time we had to upload the same photo to each of these groups and needless to say that Facebook’s image compression routine still thinks that we live in medieval age, probably King Arthur’s reign. Anyway, the process is boring and time consuming. Another quick and dirty way was to share the photo by Facebook’s group email feature but not every group supports it. So we had to find a way to make it easy for the greater part who uses both Flickr and Facebook to share their photos.

So we’ve developed Postman, a nice little app which does the job very well. Here is what/how it works.

  • Authenticate users against Flickr and Facebook and gathers necessarily permissions (read for Flickr, publish_stream and user_groups for Facebook Connect)
  • Display last 100 photos from user’s Flickr stream in a selectable grid, with the option to load more.
  • Download the 1024px version of the selected photo from Flickr Stream to our server
  • Post that photo to selected Facebook groups using FB PHP-SDK one by one.
  • Delete the photo from server

It actually solved the big problem for us. Postman made it easy for everyone of us (the photographers) and everyone literally loved it. There is one more reason to love WordPress and that is Flickr’s compression algo is really good. So when we download the 1024px version of user’s photo and then push it to Facebook, luckily Facebook  doesn’t do much on that and the photo looks really good. And we used AppFog to host Postman which ultimately proved to be very good choice.

If you are a photographer who uses Flickr to host his photos and then share to multiple Facebook groups, please give POSTMAN a try and we are sure that you will love it.

And last but not the least, Postman can post photos to your Facebook pages too. So Postman is a handy application photographers, by photographers. Use it and enjoy. You can find postman at http://postman.im

Shameless Plug

We develop beautiful Admin Panel templates for the web application developers. Our recent product is “Bolt” which is responsive and built on top of Twitter’s bootstrap. Give it a try and let us know how do you like it.

Bolt Responsive Admin Panel Template for Developers
Bolt Responsive Admin Panel Template for Developers

RackSpace Cloud Server Client Library for PHP

We, the developers at Leevio are currently developing an open source group collaboration application. We are using RackSpace Cloud servers since the very beginning of the development and we will also deploy in on rack space cloud.

As a part of our study we’d found that RackSpace provides excellent API to manage your cloud services. Unfortunately there are no language binding library released yet (for Cloud Server). But they’ve mentioned that they are developing one for python.

So we have spend our time for last two days and developed a PHP client library to use RackSpace cloud server API from inside a PHP application.

This client library is released under New BSD license. And is available to download/svn-checkout from it’s project page at http://code.google.com/p/phprackcloud/

There is plenty of documentation and example included. The code is mostly self explanatory. Please dont forget to check the Wiki page to get some idea on how to use this library and how far you can go. We have covered all available methods by RackSpace cloud server in our client library.

Happy clouding.

Project Page and Download: http://code.google.com/p/phprackcloud

Using iPaper API to convert office documents to flash movie on the fly :)

Embedding documents in web applications is a challenging work. Because you need to convert these documents into flash movie and only then you can embed them in your web applications. There are many converters available out their for use. Some of them are proprietary, Some of them comes for free. There are command line tools as well as web services also to perform these conversions and make your life easier. In this post I am going to introduce you to IPaper, an excellent service from Scribd. Using IPaper API you can upload and convert your documents to flash movie on the fly, and then you can embed them using Scribd’s excellent document viewer. Scribd offers a collection of client libraries and fortunately, we have a PHP lib in that collection.

Scribd API can convert numbers of document types including the followings

* Adobe PDF (.pdf)
* Adobe PostScript (.ps)
* Microsoft Word (.doc, .docx)
* Microsoft PowerPoint (.ppt, .pps, .pptx)
* Microsoft Excel (.xls, xlsx)
* OpenOffice Text Document (.odt, .sxw)
* OpenOffice Presentation Document (.odp, .sxi)
* OpenOffice Spreadsheet (.ods, .sxc)
* All OpenDocument formats
* Plain text (.txt)
* Rich text format (.rtf)

To use IPaper API, you need to create a developer account in ScribD and get your API key and secret key. Also, download the PHP client library from http://www.scribd.com/developers/libraries

You are ready to go once you get your Scribd api key and secret key. You can upload different types of files to scribd server and of course you can make them private or publicly accessible. After successful upload and conversion you will receive a doc_id and access_key from Scribd web service. Using those data you can embed your document in your web app. Lets have a look. In the following code examples, you may find the getEmbedUrl() and getEmbedCode() functions handy. You can also use SWFObject for quick embedding 🙂

[sourcecode lang=”php”]
<?php
include_once("scribd.php");

$UpdloadData = createIPaper("gpl.pdf","pdf","public");
$EmbedUrl = getEmbedUrl($UpdloadData);
echo $EmbedUrl;
$EmbedCode = getEmbedCode($UpdloadData);
echo $EmbedCode;

function createIPaper($File, $FileType, $Access="private")
{
$scribd_api_key = "<your API key>";
$scribd_secret = "<your Secret key>";

if (empty($FileType))
throw new Exception("Filetype cannot be empty");
$Scribd = new Scribd($scribd_api_key,$scribd_secret);

$UploadData = $Scribd->upload($File,$FileType,$Access,1);
return $UploadData;
}

function getEmbedUrl($UploadData)
{
if($UploadData){
$EmbedUrl = "http://d1.scribdassets.com/ScribdViewer.swf?document_id={$UploadData[‘doc_id’]}&access_key={$UploadData[‘access_key’]}&page=1&version=1&viewMode=list";
return $EmbedUrl;
}
}

function getEmbedCode($UploadData, $Width=450, $Height=500)
{
$EmbedCode = <<<EOD
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
id="doc_512761847372423" name="doc_512761847372423"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
align="middle"
height="{$Height}"
width="{$Width}" >
<param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf?document_id={$UploadData[‘doc_id’]}&access_key={$UploadData[‘access_key’]}&page=1&version=1&viewMode=list">
<param name="quality" value="high">
<param name="play" value="true">
<param name="loop" value="true">
<param name="scale" value="showall">
<param name="wmode" value="opaque">
<param name="devicefont" value="false">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="true">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<param name="salign" value="">
<param name="mode" value="list">
<embed src="http://d1.scribdassets.com/ScribdViewer.swf?document_id={$UploadData[‘doc_id’]}&access_key={$UploadData[‘access_key’]}&page=1&version=1&viewMode=list"
quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
play="true"
loop="true"
scale="showall"
wmode="opaque"
devicefont="false"
bgcolor="#ffffff"
name="doc_512761847372423_object"
menu="true"
allowfullscreen="true"
allowscriptaccess="always"
salign=""
type="application/x-shockwave-flash"
align="middle"
mode="list"
height="{$Height}"
width="{$Width}">
</embed>
</object>
EOD;
return $EmbedCode;
}
?>
[/sourcecode]

and here is how it will look after embedding
[scribd id=20736638 key=key-1dg5q0bof480cv4pjebo]

download the source code from here http://www.box.net/shared/5dav7hnkm9

By the way, IPaper PHP client library has some cool methods like uploadFromUrl() – Check them out )

Stay in touch, In next post I will show you how to use some other exciting tools which you can use and host in your own server :). that will be fun to host your own service like this 🙂

Thanks to Rana for helping me out with iPaper.

yo man, your browser has just been totaled!

funny, huh! but that was my case when i found all at a sudden every applications started working different in firefox 3.0.6. gmail loads in a very classic 80’s look. i tried installing firefox again but the problem remains the same. and the funniest thing happened when i tried to download the latest version of firefox from mozilla’s store/ mozilla said they don’t support mac os 9. ahem! – my one is mac os x 10.5.6

i was in the middle of developing a fbconnect application which one also stopped working. i was cluseless for an hour what actually happened. there must be something wrong with my browser agent. so i check ir and it was saying “Undefined Google ToolbarBB” – WTF!!

ok, soon after a while i remember that i had installed “Google Bookmarks Button” extension in afternoon. and i searched couple of places how to solve this problem. the solution is comparatively easy – just go to your “about:config” section and type “general.useragent” and you will find an entry with that value “google toolbarBB”. i’ve found that entry and just restored it to default.

later, to make sure of it – i opened the source code of Google Bookmark Button and i found the code where it was changing the value of default user agent! WTF!

so man, if your browser is totaled, relax and have a coffee and blame yourself for installing stupid extensions! i did!

browsing from a “totaled” browser is funny! DIY – lol!