• Resolved xac369

    (@xac369)


    Hi,

    This is a patch for instagram service update :

    ### Eclipse Workspace Patch 1.0
    #P instagram-slider-widget
    Index: instaram_slider.php
    ===================================================================
    --- instaram_slider.php	(revision 1415572)
    +++ instaram_slider.php	(working copy)
    @@ -882,7 +882,7 @@
     			$user_opt['attachment']    = $attachment;
    
     			if ( 'user' == $search ) {
    -				$response = wp_remote_get( 'http://instagram.com/' . trim( $search_string ), array( 'sslverify' => false, 'timeout' => 60 ) );
    +				$response = wp_remote_get( 'https://www.instagram.com/' . trim( $search_string ), array( 'sslverify' => false, 'timeout' => 60 ) );
     			} else {
     				$response = wp_remote_get( 'http://instagram.com/explore/tags/' . trim( $search_string ), array( 'sslverify' => false, 'timeout' => 60 ) );
     			}
    @@ -1041,6 +1041,13 @@
     	 */
     	private function save_wp_attachment( $image_data ) {
    
    +		$image_filename = $image_data['url'];
    +		if (preg_match("#(.*)\?.*#", $image_filename, $matches) ):
    +			$image_filename = $matches[1];
    +		endif;
    +
    +		$image_data['url'] = $image_filename;
    +
     		$image_info = pathinfo( $image_data['url'] );
    
     		if ( !in_array( $image_info['extension'], array( 'jpg', 'jpe', 'jpeg', 'gif', 'png' ) ) ) {

    https://wordpress.org/plugins/instagram-slider-widget/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thanks, that worked perfectly! How did you arrive at that?

    Thread Starter xac369

    (@xac369)

    Just debugging 🙂

    Will release an update these days. They only allow 12 images now. What is this patch about ?

    Thread Starter xac369

    (@xac369)

    Hi Jetonr,

    Instagram changed two things :
    – url need https and www in instagram url
    – instagram add a parameter on filename (i remove it to find the right extension of image)

    Noted. Will add these changes on the next release next week and see if anything else pops-up.

    Thread Starter xac369

    (@xac369)

    Hej,

    Patch of trunk version, now only wp_remote url

    ### Eclipse Workspace Patch 1.0
    #P instagram-slider-widget
    Index: instaram_slider.php
    ===================================================================
    — instaram_slider.php (revision 1420166)
    +++ instaram_slider.php (working copy)
    @@ -882,9 +882,9 @@
    $user_opt[‘attachment’] = $attachment;

    if ( ‘user’ == $search ) {
    – $response = wp_remote_get( ‘http://instagram.com/’ . trim( $search_string ), array( ‘sslverify’ => false, ‘timeout’ => 60 ) );
    + $response = wp_remote_get( ‘https://www.instagram.com/’ . trim( $search_string ), array( ‘sslverify’ => false, ‘timeout’ => 60 ) );
    } else {
    – $response = wp_remote_get( ‘http://instagram.com/explore/tags/’ . trim( $search_string ), array( ‘sslverify’ => false, ‘timeout’ => 60 ) );
    + $response = wp_remote_get( ‘https://www.instagram.com/explore/tags/’ . trim( $search_string ), array( ‘sslverify’ => false, ‘timeout’ => 60 ) );
    }

    if ( is_wp_error( $response ) ) {

    Great thnx @xac369 will add your name for the contrbutions.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Patch for instagram service update’ is closed to new replies.