Know how to upload a background image using the Twitter API?

Discussion in 'Programming' started by papa_face, Apr 25, 2009.

  1. #1
    Hello,

    I am looking for someone to tell me how to upload a background image to the Twitter API.
    I am using a PHP class to interface with the API using the following method
    	/**
    	 * Updates the authenticating user's profile background image.
    	 * Expects raw multipart data, not a URL to an image.
    	 *
    	 * @remark	not implemented yet, feel free to code
    	 * @return	void
    	 * @param	string $image
    	 */
    	public function updateProfileBackgroundImage($image)
    	{
    		throw new TwitterException(null, 501);
    
    		// build parameters
    		$aParameters = array();
    		$aParameters['image'] = (string) $image;
    
    		// make the call
    		$response = $this->doCall('account/update_profile_background_image.xml', $aParameters, true);
    
    		// convert into xml-object
    		$xml = @simplexml_load_string($response);
    
    		// validate
    		if($xml == false) throw new TwitterException('invalid body');
    
    		// return
    		return (array) $this->userXMLToArray($xml, true);
    	}
    Code (markup):
    However I am getting this error:
    Fatal error: Uncaught exception 'TwitterException' with message 'Not Implemented' in /twitter.php:1230 Stack trace: #0 /process.php(42): Twitter->updateProfileBackgroundImage('simpletext.jpg') #1 {main} thrown in /twitter.php on line 1230
    Code (markup):
    I don't think I am passing the image to the API correctly. I am willing to pay someone a few dollars to point me in the right direction with this via paypal. Please PM me if you can help :)
     
    papa_face, Apr 25, 2009 IP
  2. papa_face

    papa_face Notable Member

    Messages:
    2,237
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    285
    As Seller:
    100% - 0
    As Buyer:
    0.0% - 0
    #2
    Still looking for someone to do this. All you have to do is show me how to upload a twitter background through the Twitter API successfully :)
     
    papa_face, Apr 26, 2009 IP