Web Developers

Pando can be integrated into web sites. This is an index of the documents related to integrating Pando into web sites.

A good starting point is reading our customized presentation of package information examples in JavaScript and php.

pando:forward

The pando:forward can be used to allow Pando users to easily forward Pando packages.

Opening a pando:forward link causes Pando to open the Send Window, with the package information pre-populated. This is the same window that the user would see if they selected the package in the Pando GUI and clicked the "share" button.

The user can then select the recipient of the package, using all of the mechanisms supported by Pando, including email, web embed, etc.

Pando forward URLs have the following format, where url is the URL to the Pando package:

pando:forward?url

For example, the forward link for a sample package would be:

pando:forward?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

When clicked, this link tells Pando to offer to forward the package.

Supported Versions
pando:download links are supported in Pando version 0.9.5 and newer.

Pando:stream

Pando provides a stream delivery mechanism that can be used to play files using a media player while it is being downloaded.

This mechanism is deprecated in favor of the Pando REST API, but is supported for compatibility.

There are two versions of this mechanism.

  • pando:stream starts downloading the package in streaming mode, downloading the package sequentially to disk.
  • pando:streamL starts downloading the package in streaming mode, opening the downloaded stream.

For example of pando:stream and pando:streamL:


pando:stream?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633&
key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

and


pando:streamL?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633&
key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

The behavior when opening a stream is:

  • Does not open the Pando GUI.
  • Starts downloading the package.
  • If opened with pando:streamL, opens the package as a stream.

Supported Versions
pando:stream links are supported in Pando version 1.7.0 and newer.

Pando Silverlight Demo

If you would like to see how Pando works with Silverlight, take a look at the Pando Silverlight Demo Player.

Note that this player isn't a product, but is used as an example of how one can integrate Pando into a Silverlight application relatively easily using our JavaScript libraries.

Using PandoAPI.js Installed Cookie Check

In addition to providing package info service, the PandoAPI.js javascript library also provides a Pando "install" check service. We (Pando) set a cookie named "installed" in the pando.com domain whenever we determine a user has Pando installed. Because it runs from a pando.com domain, PandoAPI can inspect this cookie. If a user has this cookie set, you can be reasonably sure they have Pando installed. If they do not, they still may have Pando installed but have removed the cookie.

To use this service on your own site, you pass callback function to the PandoAPI.hasPando() method. The callback function takes a single argument. This function is then called by the PandoAPI method, with the argument set to true or false depending on the status of the installed cookie. This allows you to modify the content of your pages with javascript depending on the cookie status. In this example we'll use this method to prepend pando:subscribe? to pando channel subscription links for users who have this cookie set, to provide a one-click subscription experience for Pando users.

First, we'll need to make sure we include the Pando javascript API in our <head> section:

<script type="text/javascript" src="http://cache.pando.com/soapservices/PandoAPI.js"></script>

Then, the below script does the following:

  • Uses the PandoAPI.hasPando() method to store a boolean variable with the result from the hasPando method
  • Defines a list of links indexed by their DOM id
  • After the window loads, rewrites links with appropriate pando:subscribe? URLs if the Pando installed cookie is detected

You can follow along with the comments:

<script type="text/javascript">
 
  // Assume Pando is not installed
  pandoInstalled = false;
 
  // Pass a simple callback function that sets pandoInstalled to true if cookie is present
  PandoAPI.hasPando(function(i){ if(i == true) pandoInstalled = true; });
 
  // Define list of channel feeds and pages
  var subscribeLinks = {
    'pandomonium': {
      'channelPage': 'http://channels.pando.com/channel/pandomonium',
      'channelFeed': 'http://feedburner.pando.com/pando/pandomonium'
    },
    'projectpedal': {
      'channelPage': 'http://channels.pando.com/channel/projectpedal',
      'channelFeed': 'http://feedburner.pando.com/pando/projectpedal'
    },
    'rocketboomhd': {
      'channelPage': 'http://channels.pando.com/channel/rocketboomhd',
      'channelFeed': 'http://feedburner.pando.com/pando/rocketboomhd'
    }
  };
 
    // Do not try to use pandoInstalled until the page is loaded;
    // the callback function may not have run yet and we want to
    // make sure our links are ready to modify
    window.onload = function(){
      // If Pando is installed, rewrite the links
      if(pandoInstalled == true) {
        // For each link
        for(channelId in subscribeLinks) {
          // Find the link to modify
          link = document.getElementById(channelId);
         
          // Change the href attribute to a pando:subscribe? link with the feed URL
          link.href = 'pando:subscribe?' + subscribeLinks[channelId]['channelFeed'];
        }
      }
    }
</script>

Then, in the body of your page, define your links with the appropriate id and with URLs that will work if javascript is not enabled:

  <ul>
    <li><a href="http://channels.pando.com/channel/pandomonium" id="pandomonium">Pandomonium</a></li>
    <li><a href="http://channels.pando.com/channel/projectpedal" id="projectpedal">Project Pedal</a></li>
    <li><a href="http://channels.pando.com/channel/rocketboomhd" id="rocketboomhd">Rocketboom</a></li>
  </ul> 

A version of this script lives on a stand-alone page here. Feel free to view the source and borrow what you need and ask any questions below. (This page also includes a server-side cookie inspection so you can tell when viewing the page whether you have the Pando "installed" cookie set, for testing purposes).

Pando Command Line released!

Pando is pleased to be able to announce the release of the Pando Command Line (pcl, pronounced "pickle"). This tool allows you to integrate Pando into web sites and other automated processes.

The Pando Command Line allows you to automate:

  • publishing content from a content management system into the Pando network, including your own package thumbnail graphics, and
  • downloading content from the Pando network.

One PCL user has already provided a Ruby script to automatically receive Pando packages via email!

We are very excited about all of the possibilities that this presents, and look forward to seeing all of the amazing things that you guys will come up with!

To request a copy of PCL, fill out the request form, and tell us whether you want the version for Windows, Mac OS X, or Linux.

pando:download (deprecated)

Pando:download URL

If you are certain that your users have Pando installed (such as if your application integrates Pando into its installation process), or users have been instructed to install Pando, opening a pando:download link allows your users to one-click download a package using Pando.

Note that if the user does not have Pando installed, either nothing will happen, or an error message will be displayed, depending on the user's operating system and browser settings. Thus, Pando recommends using Pando Package URL's for web links.

Pando one-click download URLs have the following format, where url is the URL to the Pando package:

pando:download?url

For example, the download link for the above package would be:

pando:download?http://cache.pando.com/soapservices/Package/package.pando?
   id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
   &key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

When clicked, this link tells Pando to download a package indicated by the Pando Package URL.

Examples

For the above Package URL, a one-click download link would look like:

<a href="pando:download?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
CNN: In Case you Missed It for February 12, 2007</a>.

This looks like: CNN: In Case you Missed It for February 12, 2007.

If you like, you can use this download button:

CNN: In Case you Missed It for February 12, 2007<br />
<a href="pando:download?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
<img src="http://rss.pando.com/themes/rssvideo/pando_dl_button2.png">
</a>.

This looks like:
CNN: In Case you Missed It for February 12, 2007

You can also use the Package Thumbnail URL to make an image link:

<a href="pando:download?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
<img src="http://cache.pando.com/soapservices/SendToWeb?action=thumbnail
&id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633"></a>

Which looks like:

Supported Versions

pando:download links are supported in Pando version 0.9.1 and newer.

Important Note

In many cases, using the default "Send-to-IM"-style package URL will provide a better user experience than using the pando:download links. When a user without Pando installed clicks on a pando:download link, nothing happens. When a user without Pando installed clicks on a "Send-to-IM"-style URL, they are sent to a web page explaining that they need Pando to download the package they clicked on and, in some cases, the package will begin downloading automatically upon a successful installation. In either case, users with Pando installed will be able to download the package.

Pando Command Line (PCL)

For generating or processing Pando packages from within scripts, Pando provides the Pando Command Line (PCL).

To access this tool, you will need to log in with your partner account.

If you would like access to this tool, and the documentation linked below, please register for an account on this web site, and fill out our Server Integration Toolkit request form or email me.

In the first section of this guide, we'll describe how to install PCL. This is where you can download the latest PCL binaries for Linux, Windows and Mac OS X.

Next we'll talk about how to run the PCL, allowing you to automate publishing and downloading content using Pando.

Finally, we provide an example script that uses pcl to automatically download packages from a given email address.

Do my users have Pando installed?

I just wrote up a short bit about our Pando "installed" cookie checking service, that allows web developers to discover whether their web visitors have Pando installed or not. Let us know what you think, and I'll write up an example implementation or two in the near future.

Is Pando Installed?

Update: In most cases, the PandoAPI javascript method for detecting Pando's installed status would be preferable to this approach. Here is a detailed example using javascript.

In many cases, it's helpful to know whether a user has Pando installed or not, to determine what to display on a particular web page containing Pando downloads or channel subscriptions, for example; and to better explain to your sites visitors how to acquire Pando if they don't already have it.

The Pando "Installed" Cookie

For our own web sites, we use a browser cookie to track whether a user has Pando installed or not. This cookie gets set in a user's default browser when they install Pando, and is set to never expire. The cookie's key/name is "installed" and value is set to "yes"). Because this cookie is accessible to any pando.com URL, we can make use of it in many places. For example, when a user clicks a package URL, we look for the cookie and, if it's set, we send the user the Pando file. If it's not set, we redirect them to a page explaining how to installed Pando (example).

Unfortunately, because cookies can only be read by the domain that sets them (a good thing for security purposes), other web sites cannot tell if a user has Pando installed.

"Installed" Cookie Check Service

To get around this limitation, we've implemented a simple "installed" cookie checking service you may use to discover if your users have Pando installed. To use this service, you must redirect your users (using javascript or, preferably, a server side script) to the following URL: http://www.pando.com/installcheck/?returnURL=http://example.com/ where http://example.com is an URL on your server that can handle the resultant response.

When a user visits the above URL, the pando web server looks for the Pando "installed" cookie and redirects the user back to the specified returnURL with hasPando=yes or hasPando=no appended to the URL parameters. It is up to you to receive this response and handle it in a useful way. We recommend setting your own cookie to remember the result of this check, to minimize these redirect-heavy requests.

Caveat

It's important to note that this is an imperfect solution. If a privacy-minded user frequently clears her cookies or uses a browser other than her default, the "installed" cookie might not be set even when she has Pando installed. It is important to allow users a way around a cookie check and force the cookie to be set to cover these cases.

Tell your friends about Pando!

Tell Your Friends About Pando

Spread the word about Pando by linking us from your website or blog by cutting and pasting the text below...





Syndicate content