• Resolved PeterBP

    (@peterbp)


    Hi,
    I’ve had this working really well for over a year on a site. The client has just informed that it has stopped though. Have updated the plugin but notice that it does seem to be working but the images are not getting into the media library due to corrupt URLS.

    e.g. instead of 12677145_1691450861098121_180986696_n.jpg loading happily into the media library, the following attempts to and fails: 12677145_1691450861098121_180986696_n.jpg?ig_cache_key=MTE4MTUzNDM0MjYwMTgyMTEyOA%3D%3D.2

    Any thoughts? Is this new caching by Instagram?

    Thanks,
    Peter

    https://www.ads-software.com/plugins/ifttt-instagram-gallery/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter PeterBP

    (@peterbp)

    Hi, fixed it myself by altering a function in class-ifttt-instagram-gallery.php to this, to lose the url query. Probably a cleaner way…

    public function load_instagram_image( $content_struct ) {
    		// Ingredients: Caption, Url, SourceUrl, CreatedAt, EmbedCode
    		$title          = htmlspecialchars( $content_struct['title'] );
    		$description    = $content_struct['description'];
    		$description_decoded = json_decode( $description, true ); 
    
    		$instagram_url  = $this->get_final_url( $description_decoded['Url'] );
    		$parts = parse_url($instagram_url);
    		$instagram_url = $parts['scheme'].'://'.$parts['host'].$parts['path'];
    
    		$image_url      = $this->get_final_url( $description_decoded['SourceUrl'] );
    		$parts			= parse_url($image_url);
    		$image_url	= $parts['scheme'].'://'.$parts['host'].$parts['path'];		
    
    		$filename       = $this->get_filename( $image_url );
    		$parts			= parse_url($filename);
    		$filename	= $parts['scheme'].'://'.$parts['host'].$parts['path'];		
    
    		$response       = wp_remote_get( $image_url );
    		$bits = $response['body'];
    		$this->upload_image( $filename, $title, $bits, $instagram_url );
    		$this->remove_old_images();
    	}
    Plugin Author bjoerne

    (@bjoerne)

    @peterbp: Thanks for your code. I released a new version yesterday. Your code helped me a lot and the problem should be fixed now.

    {“Url”: {{Url}}”, “SourceUrl”:” {{SourceUrl}}”}

    Is this correct or has it changed as its still up on the site

    Dont worry I came across an easier option for my needs
    1. Use pinterest to select instgram images you want and post them to a pinterest board
    2. use Pinterest Importer to upload the images to your website
    3. add the images to Contest Gallery
    Clunky but works

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Instagram URLs’ is closed to new replies.