Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Pompili committed Sep 9, 2016
1 parent 67b51cc commit 92b820f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 80 deletions.
65 changes: 25 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
django-instagram
================

A Django application based on the python-instagram API. It
allows to use some template tags to display content from Instagram.
A Django application that allows to use some template tags to display content
from an Instagram public profile.

Requirements
------------

* [Django >= 1.6](https://www.djangoproject.com/)
* [Python Instagram API](https://github.com/Instagram/python-instagram)
* [lxml](https://pypi.python.org/pypi/lxml/3.6.4)
* [requests](https://pypi.python.org/pypi/requests/2.11.1)
* [sorl-thumbnail](https://github.com/mariocesar/sorl-thumbnail)
* [Pillow](https://pypi.python.org/pypi/Pillow/3.3.1)

Installation
------------

Install django from your favourite linux packaging system if you can find it.
Or you can use pip for installing python packages that are
not listed in the package system of your distribution:
Install Django with your favourite Linux packaging system or you can use pip
for installing python packages, if Django is not an official package for
your distribution:

Use pip to install Django Instagram:

Expand Down Expand Up @@ -62,48 +65,30 @@ Usage
-----

After you are done with this, you can use the tags who need user
access to Instagram, this tag will give you a context variable
called: 'recent_media', you can display the data contained in
the recent_media list like this:
access to Instagram, this tag will give you two context variables
called:
- profile: Contains the who scraped object.
- recent\_media: Contains the recent media, like 10 or 12 entries or so.

You can display the data contained in recent_media list like this:

```html
{% load instagram_client %}

{% instagram_recent_media count=6 %}
{% instagram_user_recent_media intel %}

<div id="django_recent_media_wall">
{% for media in recent_media %}
<div class="django_instagram_media_wall_item">
<a href="{{ media.link }}" target="_blank" title="{{ media.caption.text }}">
<img src="{{ media|thumbnail }}"/>
<span>{{ media.caption.text }}</span>
<a href="{{ media.display_src }}" target="_blank" title="{{ media.caption }}">
<img src="{{ media.thumbnail_src }}"/>
<span>{{ media.caption }}</span>
</a>
</div>
{% endfor %}
</div>
```

To get Instagram popular media you don't need an access token
instead, so you can ignore the last configuration step above.

```html
{% load instagram_client %}

{% instagram_popular_media count=10 %}
<div id="django_instagram_media_wall">
{% for media in popular_media %}
<div class="django_instagram_media_wall_item">
<a href="{{ media.link }}" target="_blank" title="{{ media.caption.text }}">
<img src="{{ media|standard_size }}"/>
<span>{{ media.caption.text }}</span>
</a>
</div>
{% endfor %}
</div>
```

This tag will give you a context variable called: 'popular_media'

There are also two inclusion tags that includes an example of
how to parse data from Instagram, you can also use them like
this:
Expand All @@ -112,10 +97,10 @@ this:
{% load instagram_client %}

<h1>Instagram media wall</h1>
{% instagram_recent_media_wall %}
{% instagram_recent_media_wall usename="intel" %}

<h1>Instagram sliding box</h1>
{% instagram_recent_media_box %}
{% instagram_recent_media_box usename="intel" %}
```

Filters
Expand All @@ -129,7 +114,7 @@ For standard size:
```html
{% for media in recent_media %}
...
<img src="{{ media|standard_size }}"/>
<img src="{{ media.thumbnail_src|standard_size }}"/>
...
{% endfor %}
```
Expand All @@ -139,7 +124,7 @@ For low resolution images:
```html
{% for media in recent_media %}
...
<img src="{{ media|low_resolution }}"/>
<img src="{{ media.thumbnail_src|low_resolution }}"/>
...
{% endfor %}
```
Expand All @@ -149,13 +134,13 @@ For thumbnail size:
```html
{% for media in recent_media %}
...
<img src="{{ media|thumbnail }}"/>
<img src="{{ media.thumbnail_src|thumbnail }}"/>
...
{% endfor %}
```

Releases
--------

* 0.2.0 New scraping algorithm, removed Python Instagram.
* 0.1.1 Numerous bug fixes, better documentation.
* 0.1.0 Work in progress version.
66 changes: 26 additions & 40 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@
django-instagram
================

A Django application based on the python-instagram API. It allows to use some
template tags to display content from Instagram.
A Django application that allows to use some template tags to display content
from an Instagram public profile.

------------
Requirements
------------

* `Django >= 1.6 <https://www.djangoproject.com/>`_
* `Python Instagram API <https://github.com/Instagram/python-instagram>`_
* `lxml <https://pypi.python.org/pypi/lxml/3.6.4>`_
* `requests <https://pypi.python.org/pypi/requests/2.11.1>`_
* `sorl-thumbnail <https://github.com/mariocesar/sorl-thumbnail>`_
* `Pillow <https://pypi.python.org/pypi/Pillow/3.3.1>`_

------------
Installation
------------

Install django from your favourite linux packaging system if you can find it.
Or you can use pip for installing python packages that are
not listed in the package system of your distribution:
Install Django with your favourite linux packaging system or you can use pip
for installing python packages, if Django is not an official package for
your distribution:

Use pip to install Django Instagram:

Expand Down Expand Up @@ -66,48 +69,31 @@ Usage
-----

After you are done with this, you can use the tags who need user
access to Instagram, this tag will give you a context variable
called: 'recent_media', you can display the data contained in
the recent_media list like this:
access to Instagram, this tag will give two context variables
called:

- profile:
- recent_media:

You can display the data contained in recent_media list like this:

.. code-block:: html

{% load instagram_client %}

{% instagram_recent_media count=6 %}
{% instagram_user_recent_media intel %}

<div id="django_recent_media_wall">
{% for media in recent_media %}
<div class="django_instagram_media_wall_item">
<a href="{{ media.link }}" target="_blank" title="{{ media.caption.text }}">
<img src="{{ media|thumbnail }}"/>
<span>{{ media.caption.text }}</span>
<a href="{{ media.display_src }}" target="_blank" title="{{ media.caption }}">
<img src="{{ media.thumbnail_src }}"/>
<span>{{ media.caption }}</span>
</a>
</div>
{% endfor %}
</div>

To get Instagram popular media you don't need an access token
instead, so you can ignore the last configuration step above.

.. code-block:: html

{% load instagram_client %}

{% instagram_popular_media count=10 %}
<div id="django_instagram_media_wall">
{% for media in popular_media %}
<div class="django_instagram_media_wall_item">
<a href="{{ media.link }}" target="_blank" title="{{ media.caption.text }}">
<img src="{{ media|standard_size }}"/>
<span>{{ media.caption.text }}</span>
</a>
</div>
{% endfor %}
</div>

This tag will give you a context variable called: 'popular_media'

There are also two inclusion tags that includes an example of
how to parse data from Instagram, you can also use them like
this:
Expand All @@ -117,10 +103,10 @@ this:
{% load instagram_client %}

<h1>Instagram media wall</h1>
{% instagram_recent_media_wall %}
{% instagram_recent_media_wall username="intel" %}

<h1>Instagram sliding box</h1>
{% instagram_recent_media_box %}
{% instagram_recent_media_box username="intel" %}

-------
Filters
Expand All @@ -135,7 +121,7 @@ For standard size:

{% for media in recent_media %}
...
<img src="{{ media|standard_size }}"/>
<img src="{{ media.thumbnail_src|standard_size }}"/>
...
{% endfor %}

Expand All @@ -145,7 +131,7 @@ For low resolution images:

{% for media in recent_media %}
...
<img src="{{ media|low_resolution }}"/>
<img src="{{ media.thumbnail_src|low_resolution }}"/>
...
{% endfor %}

Expand All @@ -155,13 +141,13 @@ For thumbnail size:

{% for media in recent_media %}
...
<img src="{{ media|thumbnail }}"/>
<img src="{{ media.thumbnail_src|thumbnail }}"/>
...
{% endfor %}

--------
Releases
--------

* 0.2.0 New scraping algorithm, removed Python Instagram.
* 0.1.1 Numerous bug fixes, better documentation.
* 0.1.0 Work in progress version.

0 comments on commit 92b820f

Please sign in to comment.