Giter VIP home page Giter VIP logo

rndpic's Introduction

rndpic

An App Engine application serving random Picasa Web images. This application will always be deployed at rndpic.appspot.com. It offers multiple ways to embed the picture in your web page:

Script Tag

The most basic form can be achieved by including the following snippet on your web page:

<script type=”text/javascript” src=”http://rndpic.appspot.com/user/your.username“></script>

Replace "your.username" with the name of your Picasa Web username.

If you want to customize the size of the thumbnail returned pass a "?size=" option:

<script type=”text/javascript” src=”http://rndpic.appspot.com/user/your.username?size=320u“></script>

A list of valid sizes can be found in the Picasa Web API reference at http://code.google.com/apis/picasaweb/docs/2.0/reference.html#Parameters. Look for explanations on "thumbsize".

If you don't want the image to be a link to the full version, simply add "?link=0":

<script type=”text/javascript” src=”http://rndpic.appspot.com/user/your.username?link=0“></script>

If you want to restrict the choice to a single album append an "album_id" parameter:

<script type=”text/javascript” src=”http://rndpic.appspot.com/user/your.username?album_id=8273376044385732429“></script>

To figure out the proper value for "album_id", simply visit your Picasa Web Album and look in the HTML sources for a string of the form "/albumid/1234567890123" - the digits after "/albumid/" represent the ID of the album.

JSON RPC

In case you want to have full control over how the image is displayed, rndpic now also offers serving raw JSON:

    $ curl "http://rndpic.appspot.com/json/your.username?size=320u"
    {
      "target_url": "https:\/\/...",
      "width": 320,
      "thumbnail_url": "http:\/\/...",
      "height": 240
    }

An example of this in action can be seen at http://rndpic.appspot.com/examples/slideshow.html. To get an idea on how to use it, check out the sources at https://github.com/pmoor/rndpic/blob/master/examples/slideshow.html

Image Tag

If you're not able to use JavaScript there's a simple integration method using an img tag:

    <img src="http://rndpic.appspot.com/img/your.username"/>

Please note that this will just embed the picture on your site but it will not be linked to the full-resolution version on Picasa Web.

rndpic's People

Contributors

pmoor avatar

Stargazers

 avatar Sergey Vasylchenko avatar igor milla avatar Jeremy Malais avatar  avatar

Watchers

James Cloos avatar Sergey Vasylchenko avatar  avatar Jeremy Malais avatar

rndpic's Issues

method to not pull images for which size is unavailable?

Hi thanks for this fantastic component. Is there a way to get it to ignore images if they don't have the size requested available? For example, I am pulling 1600 but many of my pics are not that wide so I would like to ignore those that don't match that width or greater. Is this possible? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.