Skip to content

Commit

Permalink
fix login detecting and update repo name
Browse files Browse the repository at this point in the history
  • Loading branch information
kricha committed May 31, 2018
1 parent 2435e6c commit 22e787a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 62 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Instabrowser
[![Build Status](https://travis-ci.org/aLkRicha/insta_browser.svg?branch=master)](https://travis-ci.org/aLkRicha/insta_browser)
[![Build Status](https://travis-ci.org/kricha/insta_browser.svg?branch=master)](https://travis-ci.org/kricha/insta_browser)
[![PyPI](https://img.shields.io/pypi/v/insta_browser.svg)](https://pypi.org/pypi/insta_browser)

💻 Library for instagram.com automation.
Expand Down Expand Up @@ -36,7 +36,7 @@
| following | 211 |
| video views | 6138 |
| |
+--------- https://github.com/aLkRicha/insta_browser ----------+
+--------- https://github.com/kricha/insta_browser ----------+
+--------------------------------------------------------------+
| top liked posts |
+--------------------------------------------------------------+
Expand Down Expand Up @@ -76,4 +76,4 @@

```

Other examples can be seen in my repository: [insta_bot](https://github.com/aLkRicha/insta_bot)
Other examples can be seen in my repository: [insta_bot](https://github.com/kricha/insta_bot)
104 changes: 50 additions & 54 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,89 +1,85 @@
Instabrowser
============

|Build Status| |PyPI|
`Build Status <https://travis-ci.org/kricha/insta_browser>`__
`PyPI <https://pypi.org/pypi/insta_browser>`__

| 💻 Library for instagram.com automation.
| ♥️ Like instagram feed, username profile, location, tag.
| 🤝 Auto-follow unknown users, during liking, from locations or tags.
| 📊 Get statistic of any public account.
Requirements
------------
~~~~~~~~~~~~

- Python 3
- `ChromeDriver <https://sites.google.com/a/chromium.org/chromedriver/downloads>`__
for headless web-surfing

Examples
--------
~~~~~~~~

- Example of using package for getting account statistic:

.. code:: python
from insta_browser import InstaMeter
im = InstaMeter(username='al_kricha')
im.analyze_profile()
im.print_account_statistic()
im.print_top_liked()
from insta_browser import InstaMeter
im = InstaMeter(username='al_kricha')
im.analyze_profile()
im.print_account_statistic()
im.print_top_liked()
result:

.. code:: bash
+-- https://instagram.com/al_kricha/ --------------------------+
| counter | value |
+------------------------------+-------------------------------+
| followed | 402 |
| posts | 397 |
| comments | 1602 |
| likes | 20429 |
| following | 211 |
| video views | 6138 |
| |
+--------- https://github.com/aLkRicha/insta_browser ----------+
+--------------------------------------------------------------+
| top liked posts |
+--------------------------------------------------------------+
| https://instagram.com/p/BVIUvMkj1RV/ - 139 likes |
| https://instagram.com/p/BTzJ38-DkUT/ - 132 likes |
| https://instagram.com/p/BI8rgr-gXKg/ - 129 likes |
| https://instagram.com/p/BW-I6o6DBjm/ - 119 likes |
| https://instagram.com/p/BM4_XSoFhck/ - 118 likes |
| https://instagram.com/p/BJVm3KIA-Vj/ - 117 likes |
| https://instagram.com/p/BIhuQaCgRxI/ - 113 likes |
| https://instagram.com/p/BM6XgB2l_r7/ - 112 likes |
| https://instagram.com/p/BMHiRNUlHvh/ - 112 likes |
| https://instagram.com/p/BLmMEwjlElP/ - 111 likes |
+--------------------------------------------------------------+
+-- https://instagram.com/al_kricha/ --------------------------+
| counter | value |
+------------------------------+-------------------------------+
| followed | 402 |
| posts | 397 |
| comments | 1602 |
| likes | 20429 |
| following | 211 |
| video views | 6138 |
| |
+--------- https://github.com/kricha/insta_browser ----------+
+--------------------------------------------------------------+
| top liked posts |
+--------------------------------------------------------------+
| https://instagram.com/p/BVIUvMkj1RV/ - 139 likes |
| https://instagram.com/p/BTzJ38-DkUT/ - 132 likes |
| https://instagram.com/p/BI8rgr-gXKg/ - 129 likes |
| https://instagram.com/p/BW-I6o6DBjm/ - 119 likes |
| https://instagram.com/p/BM4_XSoFhck/ - 118 likes |
| https://instagram.com/p/BJVm3KIA-Vj/ - 117 likes |
| https://instagram.com/p/BIhuQaCgRxI/ - 113 likes |
| https://instagram.com/p/BM6XgB2l_r7/ - 112 likes |
| https://instagram.com/p/BMHiRNUlHvh/ - 112 likes |
| https://instagram.com/p/BLmMEwjlElP/ - 111 likes |
+--------------------------------------------------------------+
- Example of using package for liking specific user:

.. code:: python
import os
from insta_browser import browser
import os
from insta_browser import browser
br = browser.Browser(
debug=True,cookie_path=os.path.join('var', 'cookies'),
log_path=os.path.join('var', 'logs'),
db_path=os.path.join('var', 'db'),
exclude=os.path.join('var', 'exclude.txt'),
auto_follow=True
)
br = browser.Browser(
debug=True,cookie_path=os.path.join('var', 'cookies'),
log_path=os.path.join('var', 'logs'),
db_path=os.path.join('var', 'db'),
exclude=os.path.join('var', 'exclude.txt'),
auto_follow=True
)
try:
br.auth('YOUR_INSTA_LOGIN', 'YOUR_INSTA_PASSWORD')
br.process_user('al_kricha')
print(br.get_summary())
finally:
br.close_all()
try:
br.auth('YOUR_INSTA_LOGIN', 'YOUR_INSTA_PASSWORD')
br.process_user('al_kricha')
print(br.get_summary())
finally:
br.close_all()
Other examples can be seen in my repository:
`insta_bot <https://github.com/aLkRicha/insta_bot>`__

.. |Build Status| image:: https://travis-ci.org/aLkRicha/insta_browser.svg?branch=master
:target: https://travis-ci.org/aLkRicha/insta_browser
.. |PyPI| image:: https://img.shields.io/pypi/v/insta_browser.svg
:target: https://pypi.org/pypi/insta_browser
`insta_bot <https://github.com/kricha/insta_bot>`__
2 changes: 1 addition & 1 deletion insta_browser/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def auth_with_credentials(browser, logger, login, password, cookie_path=tempfile

def check_if_user_authenticated(browser):
try:
browser.find_element_by_css_selector(".coreSpriteDesktopNavProfile")
browser.find_element_by_css_selector(".logged-in")
return True
except excp.NoSuchElementException:
return False
2 changes: 1 addition & 1 deletion insta_browser/meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def print_account_statistic(self):
for key, value in stats.items():
print('| {:<27}|{:^31}|'.format(key, value))
print('|{: ^62}|'.format(''))
print('+{:-^62}+'.format(' https://github.com/aLkRicha/insta_browser '))
print('+{:-^62}+'.format(' https://github.com/kricha/insta_browser '))

def __print_top(self, posts, header_text, key, counter_text):
self.__check_user_before_print()
Expand Down
2 changes: 1 addition & 1 deletion insta_browser/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.8.5.3'
__version__ = '0.8.5.4'
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
long_description=description,
author='Aleksej Krichevsky',
author_email='[email protected]',
url='https://github.com/aLkRicha/insta_browser',
download_url='https://github.com/aLkRicha/insta_browser/archive/{}.tar.gz'.format(version),
url='https://github.com/kricha/insta_browser',
download_url='https://github.com/kricha/insta_browser/archive/{}.tar.gz'.format(version),
keywords=['parsing', 'bot', 'instabot', 'automation', 'likes'],
license='MIT',
classifiers=[ # look here https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 22e787a

Please sign in to comment.