Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

new (mini) feature -- instagr.am urls #495

Closed
amygdala opened this Issue · 3 comments

2 participants

@amygdala

adding this clause to processTweetURLs will find the instagr.am jpg urls :). However, it requires screen scraping-- is this too ugly? If not, I will add this to an upcoming branch of mine. (or if you prefer you can just add it at your end).

        // thanks to tweetnest for the screen scraping regexp
        elseif (substr($u, 0, strlen('http://instagr.am/')) == 'http://instagr.am/') {
            $logger->logInfo("processing instagram url: $u", __METHOD__.','.__LINE__);
            $html = (string) Utils::getURLContents($u);
            preg_match('/<meta property="og:image" content="[^"]+"\/>/i', $html, $matches);
            if (isset($matches[0])) {
                $eurl = substr($matches[0], 35, -3);
                //$logger->logInfo("got instagram eurl: $eurl", __METHOD__.','.__LINE__);
                $is_image = 1;
            }
        }
@ginatrapani
Owner

Instagram thumbnails--sweet! I want this.

The perfectionist in me thinks we should either make an Instagram plugin, or rename the Flickr Thumbnails plugin to Image Thumbnails and do this there. The realist, however, realizes that's way more involved and that this works just fine.

Realist wins. Let's add this as is. You're on fire!

@amygdala

actually, it turns out that this image is too big (and from the page source there appears to be no smaller thumbnail to scrape). But it's not huge and would still be quick to load.
So what I will do if it's okay w/ you is also define a max-height for the picture style css rule so that they will be scaled down as necessary. (I'll stare @ the css first and make sure I'm changing the the right rule).

Update:
adding this to base.css should to the trick:
.pic img {max-height: 150px; }
Because in my 'retweets' branch I pulled 'processTweetURLs' into its own class, I will hold off on pushing out these changes just now. I'll make a note and do it after we deal with the 'retweets' change (which might be after the holidays).

@ginatrapani
Owner

Merged!
287f945
Thanks, Amy.

@unruthless unruthless referenced this issue from a commit in unruthless/ThinkUp
@amygdala amygdala Issue #495: Instagr.am support
* Added instagr.am support to the URLProcessor class
* Modified base.css to define max image height of 150px
* Added tests
287f945
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.