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

Closed
amygdala opened this Issue Dec 14, 2010 · 3 comments

Comments

Projects
None yet
2 participants
@amygdala
Contributor

amygdala commented Dec 14, 2010

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

This comment has been minimized.

Show comment Hide comment
@ginatrapani

ginatrapani Dec 14, 2010

Member

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!

Member

ginatrapani commented Dec 14, 2010

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

This comment has been minimized.

Show comment Hide comment
@amygdala

amygdala Dec 15, 2010

Contributor

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).

Contributor

amygdala commented Dec 15, 2010

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

This comment has been minimized.

Show comment Hide comment
@ginatrapani

ginatrapani Dec 29, 2010

Member

Merged!
287f945
Thanks, Amy.

Member

ginatrapani commented Dec 29, 2010

Merged!
287f945
Thanks, Amy.

unruthless pushed a commit to unruthless/ThinkUp that referenced this issue Apr 27, 2011

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

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment