Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joachimesque/pyctogram
A scrapper & web viewer for Instagram, written in Python.
https://github.com/joachimesque/pyctogram
instagram instagram-scraper python python3
Last synced: 3 months ago
JSON representation
A scrapper & web viewer for Instagram, written in Python.
- Host: GitHub
- URL: https://github.com/joachimesque/pyctogram
- Owner: joachimesque
- License: agpl-3.0
- Created: 2018-06-17T12:16:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T04:58:47.000Z (about 2 years ago)
- Last Synced: 2024-07-30T19:12:03.880Z (6 months ago)
- Topics: instagram, instagram-scraper, python, python3
- Language: CSS
- Size: 225 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ท Pyctogram
![](https://img.shields.io/badge/please-help-yellow.svg)
![](https://img.shields.io/badge/trapped_in-SVG_factory-red.svg)
![](https://img.shields.io/badge/running_out-of_XML-yellow.svg)
![](https://img.shields.io/badge/send-tags-orange.svg)A scraper & viewer for Instagram, written in Python.
## โ Whatโs the deal?
Due to various gripes I have with [Instagram](https://instagram.com), I am deleting my account. But there are many of my friends who still use it, and I want to keep on looking at their pictures.
This project aims to create a simple way to see my friendโs latest posts on my computer. The code may be adapted to work on some web hosts or cloud solutions, but itโs still pretty much in development so proceed with care.
Itโs my first real *coding* project. Iโm a webdesigner who dabbles in Python, and I wanted to scratch an itch. I donโt know anything about software architecture and very little about databases. If you have suggestions for better, nicer, cleaner ways of doing things, please open an issue!
## ๐ How it works
The code is in Python 3.6. It uses Flask, BeautifulSoup, sqlite3.
The scraping can be done regularly (with a `cron`), or called by the user. The script visits the profile pages of the Instagram users listed, and saves the info in the database. The images are not saved on disk at this point. Of course, if an Insatgram profile is hidden, no info can be saved.
A Flask-based web app lets you browse the saved info, as an image feed (much like an Instagram feed, in the right order and without the ads), as a user profile, or as a specific media page. Thereโs also the possibiltiy to Save (and Forget) some media, in which case the app saves the image on the disk.
## โ How to install it
After cloning the repo, install Python virtualenv and packages:
```bash
$ cd Pyctogram
$ make install
```When itโs done, initialize the database and run the server:
```bash
$ make init-db
$ make serve
```
And open a browser page to `http://127.0.0.1:5000/`.On production, you can run the server with this command (works with [Gunicorn](http://flask.pocoo.org/docs/1.0/deploying/wsgi-standalone/#gunicorn))
```bash
$ make run
```## โ How to use it
### Add contacts
You must register to access the account importer.After registration, you can add accounts to the default feed by importing `connections.json` file from your [Instagram Data Archive](https://help.instagram.com/181231772500920).
You can also add accounts from a text file or directly on the application.### Get accounts media
To update accounts media, you can run the following command:
```bash
$ make update-media
```
It updates all accounts regardless of users or lists (recommanded way to update feeds, can be done with a cron).You can also update media from the web interface for the fedd or a list (not recommanded yet, if the feed/list has a lot of contacts).
## ๐ To Do
- ~~๐ผ Display the "Sidecar" objects (when thereโs many photos in a single post)~~
- ~~๐ Display latest likes and comments on Media view~~ Following changes by Instagram, it wonโt work.
- ~~๐ Importing Instagram-exported accounts lists~~
- โฌ Calling the scraper from the web interface (with a nice Progress Bar component)
- Optimize the scraper performances
- ๐ช Better Bulma Customization
- More emoji
- ~~๐ Some JS to help with the navigation (*j*, *k*, *l*, like on Flickr)~~
- ~~๐ DRY the templates~~
- ๐ Easy Install, esp. on web hosts
- ~~๐ Lists ! Like Twitter lists,~~ with the possibility to call for a scrape for a specific list
- ๐ Albums
- ๐ฒ Webapp-ify (keep the app on a server, but allow the webapp to download the saved pictures on the phone, to keep a feed of saved photos offline)
- ~~๐ โHide from feedโ if you want a contact to appear in lists, but not in your main feed~~
-Configuration for "production" environnements## ๐ Copyrights and License
The Instagram copyrights and brand belong to Facebook, Inc.
Unless otherwise specified, this code is copyright 2018 Joachim Robert and released under the GNU Affero General Public License v3.0. Learn more about this license : https://choosealicense.com/licenses/agpl-3.0/
This work uses code from:
- [Bulma](https://github.com/jgthms/bulma), which is copyright 2018 Jeremy Thomas and whose code is released under [the MIT license](https://github.com/jgthms/bulma/blob/master/LICENSE).
- [Slider](https://github.com/cferdinandi/slider), whose code is released under [the MIT license](https://github.com/jgthms/bulma/blob/master/LICENSE)