Automattic / media-explorer

With Media Explorer, you can now search for tweets and videos on Twitter and YouTube directly from the Add Media screen in WordPress.
126 stars 31 forks source link

Twitter media previews #34

Open paulgibbs opened 11 years ago

paulgibbs commented 11 years ago

For tweets with pictures, is it possible to show those previews in the Media Explorer? Do we get the media URL back in the search results?

I thought I had seen discussion about this already but can't find it.

pepegar commented 11 years ago

We can retrieve the "entities" for each tweet. Entities are all the non-text content inserted in a tweet (photo, location, Vine, news from magazines...) but, they are not identified, so we can't determine whether a entity is a photo or not... I will still investigating though.

paulgibbs commented 11 years ago

If we can get the location, it would be cool if we can add extra pins to the Google Maps box so you can select search results by clicking on those pins

johnbillion commented 11 years ago

Sorry chaps I meant to reply to this ticket. There is a 'media' item in the 'entities' object for each tweet if a tweet contains media such as image or video.

If I recall correctly the issue we had when we originally discussed this was that Twitter doesn't tell you the media type, and it doesn't generate thumbnails for media attached to tweets, so we'd be displaying potentially full-sized images on the screen, scaled down in the browser (this is actually what happens on Twitter.com).

I just had a peek at the API response from Twitter and there is a 'sizes' item in the 'media' array, but it's not clear what this is for. Might need to be cross-checked with the API docs.

paulgibbs commented 11 years ago

https://dev.twitter.com/docs/tweet-entities

simonwheatley commented 11 years ago

The method of appending a :[size] to the URL still seems to work, though I can't find documentation for it. Examples in ascending order of size:

  1. https://pbs.twimg.com/media/BSvSv7FIcAErIqT.jpg:thumb
  2. https://pbs.twimg.com/media/BSvSv7FIcAErIqT.jpg
  3. https://pbs.twimg.com/media/BSvSv7FIcAErIqT.jpg:small
  4. https://pbs.twimg.com/media/BSvSv7FIcAErIqT.jpg:large
paulgibbs commented 11 years ago

Regarding the scaling of images, we can use Photon to handle that (and caching there-of) http://jetpack.me/2013/07/11/photon-and-themes/

paulgibbs commented 11 years ago

Moving to future release. I think we need to think about the UI -- where to show the images. The twitter results are already limited to 400px or so wide, and on a large monitor, you get a lot of blank space.

Thinking there's some reorganising we can do; maybe even introduce another side-column (on the right?) where media is previewed. However this is done, we should keep the UX consistent with #7