3 Media entity provides a 'base' entity for a media element. This is a very basic
4 entity which can reference to all kinds of media-objects (local files, YouTube
5 videos, tweets, CDN-files, ...). This entity only provides a relation between
6 Drupal (because it is an entity) and the resource. You can reference to this
7 entity within any other Drupal entity.
9 ## About Media entity Instagram
11 This module provides Instagram integration for Media entity (i.e. media type provider
14 ### Without Instagram API
15 If you need just to embembed instagrams you can use this module without using Instagram's API. That will give you access to the shortcode field available from the url/embed code.
19 - Create a Media bundle with the type provider "Instagram".
20 - On that bundle create a field for the Instagram url/source (this should be a plain text or link field).
21 - Return to the bundle configuration and set "Field with source information" to use that field.
23 **IMPORTANT:** beware that there is limit on the number of request that can be made for free. [Read more](http://instagram.com/developer/endpoints/)
26 ### With Instagram API
27 If you need to get other fields, you will need to use Instagram's API. To get this working follow the steps below:
29 - Download and enable [composer_manager](https://www.drupal.org/project/composer_manager). Also make sure you have [drush](https://github.com/drush-ops/drush) installed.
30 - Run the following commands from within your Drupal root directory to download the [library](https://github.com/galen/PHP-Instagram-API) that will handle the communication:
33 // Rebuild the composer.json file with updated dependencies.
34 $ drush composer-json-rebuild
36 // Install the required packages.
37 $ drush composer-manager install
39 - Create a instagram app on the instagram [developer site](http://instagram.com/developer/register/)
40 - Enable read access for your instagram app
41 - Grab your client ID from the instagram developer site
42 - In your Instagram bundle configuration set "Whether to use Instagram api to fetch instagrams or not" to "Yes"" and paste in the "Client ID"
44 **NOTE:** We are currently using a patched version of the library with the ability to get the media by shortcode. This is the pull request for it: https://github.com/galen/PHP-Instagram-API/pull/46/files
46 ### Storing field values
47 If you want to store the fields that are retrieved from Instagram you should create appropriate fields on the created media bundle (id) and map this to the fields provided by Instagram.php.
49 **NOTE:** At the moment there is no GUI for that, so the only method of doing that for now is via CMI.
51 This would be an example of that (the field_map section):
58 - media_entity_instagram
61 description: 'Instagram photo/video to be used with content.'
65 use_instagram_api: '1'
66 client_id: YOUR_CLIENT_ID
70 thumbnail: instagram_thumbnail
71 username: instagram_username
72 caption: instagram_caption
76 Project page: http://drupal.org/project/media_entity_instagram
79 - Janez Urevc (@slashrsm) drupal.org/user/744628
80 - Malina Randrianavony (@designesse) www.drupal.org/user/854012
82 IRC channel: #drupal-media