Support » Plugin: EP Hashimage » [Plugin: EP Hashimage] Instragram 301 Error (fix suggestion)

  • Resolved ndenitto

    (@ndenitto)


    Hey guys,

    So I think Instragram changed something with their links. When I noticed Instragram was not working, I investigated and sure enough: the old ‘instragr.am’ links REDIRECT to ‘instagram.com’. Luckily, the second part of the link is the same. Let me tell you, CURL does NOT LIKE a redirect like that, though, and throws a 301 error. Your script then ignores the image.

    Pretty simple fix, though. Just modded the following function:

    private function _extractinstagram($link){
    		$link = trim($link);
    
    		$search = 'instagr.am';
    		$replace = 'instagram.com';
    
    		$link = str_replace( $search, $replace, $link );
    
    		$string = $this->_fetchurl($link);
    
    		if(isset($string)){
    			preg_match_all('!<img class="photo" src="(.*)" />!', $string, $matches);
    			if(isset($matches[1][0]) && !empty($matches[1][0])){
    				return $matches[1][0];
    			}
    		}
    	}

    http://wordpress.org/extend/plugins/ep-hashimage/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: EP Hashimage] Instragram 301 Error (fix suggestion)’ is closed to new replies.