zMobyPicturePlugin - 1.0.1

Mobypicture API client and tools packaged as symfony plugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

zMobyPicture plugin

The zMobyPicturePlugin is a symfony plugin that provides client for mobypicture.com API (http://api.mobypicture.com). To call any of API methods developer key is needed. You can get it from http://www.mobypicture.com/app/new.

Basic Usage

  • Create client instance. You need to get developer key first to call any API method.

    $client = new zMobyPictureClient('myKeyGotFromMobyPicture');
  • Check whether the user is a valid Mobypicture user

    $response = $client->checkCredentials('myUser', '1234', zMobyPictureClient::FORMAT_PLAIN);
  • Get information about the posting

    $response = $client->getMediaInfo('57glx6', zMobyPictureClient::FORMAT_XML);
  • Get thumbnail URL

    $response = $client->getThumbUrl('57glx6', zMobyPictureClient::SIZE_THUMBNAIL, zMobyPictureClient::FORMAT_XML);
  • Post media. You can use two variations of post media methods - postMedia and postMediaUrl. First one simply returns whether call was succesful. The later returns tinyurl of the post on Mobypicture. It doesn't matter which format is set. Method always returns plain text.

    $response = $client->postMedia('/home/kuba/myImage.png', 'myUser', '1234');
    $response = $client->postMediaUrl('/home/kuba/anotherImage.png', 'myUser', '1234');
    $response = $client->postMediaUrl(
      '/home/kuba/oneMoreImage.png', 
      'myUser', 
      '1234',
      array(
        'title'       => 'Test XML',
        'description' => 'Testing MobyPicture API client in PHP',
        'tags'        => 'test,php,symfony,api',
        'location'    => '54.317024,18.568354',
        'hashtags'    => '#020',
        'services'    => 'none,+twitter'
      ), 
      zMobyPictureClient::FORMAT_XML
    );

Format types

All the client methods take response format type as the last parameter.

  • Plain

    zMobyPictureClient::FORMAT_PLAIN
  • Json

    zMobyPictureClient::FORMAT_JSON
  • XML

    zMobyPictureClient::FORMAT_XML