[ create a new paste ] login | about

Link: http://codepad.org/V9ygBWgQ    [ raw code | output | fork ]

PHP, pasted on Dec 22:
<?php

$result = '{
    "ok": "ASSEMBLY_COMPLETED",
    "httpCode": 200,
    "message": "The assembly was successfully completed.",
    "assembly_id": "0a8baa295d3f721d2bdbe5ddbf2ed069df",
    "assembly_url": "http://api2.concetta.transloadit.com/assemblies/0a8baa2dd95ddd3f721d2bdbe5baf2ed069df",
    "bytes_received": 839249,
    "bytes_expected": 839249,
    "client_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7",
    "client_ip": "xxx",
    "client_referer": "http://localhost:8888/php-sdk/example/2-assembly-form.php",
    "start_date": "2011/12/22 10:51:36 GMT",
    "upload_duration": 1.523,
    "execution_duration": 1.163,
    "fields": {},
    "running_jobs": [],
    "template": "{\"steps\":{\"size_45\":{\"robot\":\"/image/resize\",\"use\":\":original\",\"width\":45,\"height\":45,\"strip\":true},\"store\":{\"robot\":\"/s3/store\",\"use\":[\"size_45\"],\"key\":\"****\",\"secret\":\"****\",\"bucket\":\"mybucket\"}}}",
    "params": "{\"template_id\":\"4924cabd2de514a3dcb0da9924e662bd979\",\"redirect_url\":\"http://localhost:8888/php-sdk/example/2-assembly-form.php\",\"notify_url\":\"http://example.com/processing/parse\",\"auth\":{\"key\":\"****\",\"expires\":\"2011/12/22 12:27:31+00:00\"}}",
    "uploads": [
        {
            "id": "37cba16f43c951d696cd4450fe2ddc852",
            "name": "7.jpg",
            "basename": "7",
            "ext": "jpg",
            "size": 838535,
            "mime": "image/jpeg",
            "type": "image",
            "field": "example_upload",
            "original_id": "37cbda16f4d3c951d696cd4450fed2dc852",
            "url": "http://tmp.transloadit.com.s3.amazonaws.com/37cbdda16df43c951d696cd4450fe2dc852",
            "meta": {
                "width": 1280,
                "height": 800,
                "date_recorded": null,
                "date_file_created": "2010/02/03 12:08:32 GMT",
                "date_file_modified": "2011/12/22 10:51:38 GMT",
                "title": null,
                "description": null,
                "location": null,
                "city": null,
                "state": null,
                "country": null,
                "country_code": null,
                "keywords": null,
                "aperture": null,
                "exposure_compensation": null,
                "exposure_mode": null,
                "exposure_time": null,
                "flash": null,
                "focal_length": null,
                "f_number": null,
                "iso": null,
                "light_value": null,
                "metering_mode": null,
                "shutter_speed": null,
                "white_balance": null,
                "device_name": null,
                "device_vendor": null,
                "device_software": "Adobe Photoshop CS4 Macintosh",
                "latitude": null,
                "longitude": null,
                "orientation": "Horizontal (normal)",
                "frame_count": null
            }
        }
    ],
    "results": {
        "size_45": [
            {
                "id": "5cb6ff0e7eba5adfa30c9fb9f2f128b459",
                "name": "7.jpg",
                "basename": "7",
                "ext": "jpg",
                "size": 1108,
                "mime": "image/jpeg",
                "type": "image",
                "field": "example_upload",
                "original_id": "37dcba16f4d3c9a51d696cd4450fe2dc852",
                "url": "http://mybucket.s3.amazonaws.com/5c/b6ff0e7ddaba5afd30c9fb9f2f128b459/7.jpg",
                "meta": {
                    "width": 45,
                    "height": 28,
                    "date_recorded": null,
                    "date_file_created": null,
                    "date_file_modified": "2011/12/22 10:51:38 GMT",
                    "title": null,
                    "description": null,
                    "location": null,
                    "city": null,
                    "state": null,
                    "country": null,
                    "country_code": null,
                    "keywords": null,
                    "aperture": null,
                    "exposure_compensation": null,
                    "exposure_mode": null,
                    "exposure_time": null,
                    "flash": null,
                    "focal_length": null,
                    "f_number": null,
                    "iso": null,
                    "light_value": null,
                    "metering_mode": null,
                    "shutter_speed": null,
                    "white_balance": null,
                    "device_name": null,
                    "device_vendor": null,
                    "device_software": null,
                    "latitude": null,
                    "longitude": null,
                    "orientation": null,
                    "frame_count": null
                }
            }
        ]
    }
}

';



$obj = json_decode($result);
echo $obj->message;


Output:
1
The assembly was successfully completed.


Create a new paste based on this one


Comments: