├── .gitignore ├── .gitmodules ├── .idea ├── inspectionProfiles │ └── profiles_settings.xml ├── instabot.iml ├── misc.xml ├── modules.xml ├── vcs.xml ├── watcherTasks.xml └── workspace.xml ├── Dockerfile ├── LICENSE ├── README.md ├── app ├── Services │ ├── Content │ │ ├── Comments.py │ │ ├── Hashtags.py │ │ ├── Images.py │ │ ├── Statistics.py │ │ ├── __init__.py │ │ ├── grab-comments.py │ │ ├── grab-statistics.py │ │ ├── phpapi │ │ │ ├── comments.php │ │ │ ├── composer.json │ │ │ ├── composer.lock │ │ │ ├── composer.phar │ │ │ ├── resources │ │ │ │ ├── comments.json │ │ │ │ └── userinformation.json │ │ │ ├── statistics.php │ │ │ └── vendor │ │ │ │ ├── autoload.php │ │ │ │ ├── composer │ │ │ │ ├── ClassLoader.php │ │ │ │ ├── LICENSE │ │ │ │ ├── autoload_classmap.php │ │ │ │ ├── autoload_files.php │ │ │ │ ├── autoload_namespaces.php │ │ │ │ ├── autoload_psr4.php │ │ │ │ ├── autoload_real.php │ │ │ │ ├── autoload_static.php │ │ │ │ └── installed.json │ │ │ │ ├── guzzlehttp │ │ │ │ ├── guzzle │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── CHANGELOG.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── UPGRADING.md │ │ │ │ │ ├── composer.json │ │ │ │ │ └── src │ │ │ │ │ │ ├── Client.php │ │ │ │ │ │ ├── ClientInterface.php │ │ │ │ │ │ ├── Cookie │ │ │ │ │ │ ├── CookieJar.php │ │ │ │ │ │ ├── CookieJarInterface.php │ │ │ │ │ │ ├── FileCookieJar.php │ │ │ │ │ │ ├── SessionCookieJar.php │ │ │ │ │ │ └── SetCookie.php │ │ │ │ │ │ ├── Exception │ │ │ │ │ │ ├── BadResponseException.php │ │ │ │ │ │ ├── ClientException.php │ │ │ │ │ │ ├── ConnectException.php │ │ │ │ │ │ ├── GuzzleException.php │ │ │ │ │ │ ├── RequestException.php │ │ │ │ │ │ ├── SeekException.php │ │ │ │ │ │ ├── ServerException.php │ │ │ │ │ │ ├── TooManyRedirectsException.php │ │ │ │ │ │ └── TransferException.php │ │ │ │ │ │ ├── Handler │ │ │ │ │ │ ├── CurlFactory.php │ │ │ │ │ │ ├── CurlFactoryInterface.php │ │ │ │ │ │ ├── CurlHandler.php │ │ │ │ │ │ ├── CurlMultiHandler.php │ │ │ │ │ │ ├── EasyHandle.php │ │ │ │ │ │ ├── MockHandler.php │ │ │ │ │ │ ├── Proxy.php │ │ │ │ │ │ └── StreamHandler.php │ │ │ │ │ │ ├── HandlerStack.php │ │ │ │ │ │ ├── MessageFormatter.php │ │ │ │ │ │ ├── Middleware.php │ │ │ │ │ │ ├── Pool.php │ │ │ │ │ │ ├── PrepareBodyMiddleware.php │ │ │ │ │ │ ├── RedirectMiddleware.php │ │ │ │ │ │ ├── RequestOptions.php │ │ │ │ │ │ ├── RetryMiddleware.php │ │ │ │ │ │ ├── TransferStats.php │ │ │ │ │ │ ├── UriTemplate.php │ │ │ │ │ │ ├── functions.php │ │ │ │ │ │ └── functions_include.php │ │ │ │ ├── promises │ │ │ │ │ ├── CHANGELOG.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── README.md │ │ │ │ │ ├── composer.json │ │ │ │ │ └── src │ │ │ │ │ │ ├── AggregateException.php │ │ │ │ │ │ ├── CancellationException.php │ │ │ │ │ │ ├── Coroutine.php │ │ │ │ │ │ ├── EachPromise.php │ │ │ │ │ │ ├── FulfilledPromise.php │ │ │ │ │ │ ├── Promise.php │ │ │ │ │ │ ├── PromiseInterface.php │ │ │ │ │ │ ├── PromisorInterface.php │ │ │ │ │ │ ├── RejectedPromise.php │ │ │ │ │ │ ├── RejectionException.php │ │ │ │ │ │ ├── TaskQueue.php │ │ │ │ │ │ ├── TaskQueueInterface.php │ │ │ │ │ │ ├── functions.php │ │ │ │ │ │ └── functions_include.php │ │ │ │ └── psr7 │ │ │ │ │ ├── CHANGELOG.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── composer.json │ │ │ │ │ └── src │ │ │ │ │ ├── AppendStream.php │ │ │ │ │ ├── BufferStream.php │ │ │ │ │ ├── CachingStream.php │ │ │ │ │ ├── DroppingStream.php │ │ │ │ │ ├── FnStream.php │ │ │ │ │ ├── InflateStream.php │ │ │ │ │ ├── LazyOpenStream.php │ │ │ │ │ ├── LimitStream.php │ │ │ │ │ ├── MessageTrait.php │ │ │ │ │ ├── MultipartStream.php │ │ │ │ │ ├── NoSeekStream.php │ │ │ │ │ ├── PumpStream.php │ │ │ │ │ ├── Request.php │ │ │ │ │ ├── Response.php │ │ │ │ │ ├── ServerRequest.php │ │ │ │ │ ├── Stream.php │ │ │ │ │ ├── StreamDecoratorTrait.php │ │ │ │ │ ├── StreamWrapper.php │ │ │ │ │ ├── UploadedFile.php │ │ │ │ │ ├── Uri.php │ │ │ │ │ ├── UriNormalizer.php │ │ │ │ │ ├── UriResolver.php │ │ │ │ │ ├── functions.php │ │ │ │ │ └── functions_include.php │ │ │ │ ├── mgp25 │ │ │ │ └── instagram-php │ │ │ │ │ ├── .github │ │ │ │ │ └── ISSUE_TEMPLATE.md │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ │ │ ├── CONTRIBUTING.md │ │ │ │ │ ├── Dockerfile │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── composer.json │ │ │ │ │ ├── devtools │ │ │ │ │ ├── README.md │ │ │ │ │ ├── checkDevices.php │ │ │ │ │ └── exceptionTest.php │ │ │ │ │ ├── examples │ │ │ │ │ ├── README.md │ │ │ │ │ ├── accessingValues.php │ │ │ │ │ ├── assets │ │ │ │ │ │ └── instagram.png │ │ │ │ │ ├── customSettings.php │ │ │ │ │ ├── paginationExample.php │ │ │ │ │ ├── shortcodeConverter.php │ │ │ │ │ ├── uploadAlbum.php │ │ │ │ │ ├── uploadPhoto.php │ │ │ │ │ └── uploadVideo.php │ │ │ │ │ └── src │ │ │ │ │ ├── AutoPropertyHandler.php │ │ │ │ │ ├── Client.php │ │ │ │ │ ├── ClientMiddleware.php │ │ │ │ │ ├── Constants.php │ │ │ │ │ ├── Debug.php │ │ │ │ │ ├── Devices │ │ │ │ │ ├── Device.php │ │ │ │ │ ├── GoodDevices.php │ │ │ │ │ └── UserAgent.php │ │ │ │ │ ├── Exception │ │ │ │ │ ├── AccountDisabledException.php │ │ │ │ │ ├── CheckpointRequiredException.php │ │ │ │ │ ├── EmptyResponseException.php │ │ │ │ │ ├── EndpointException.php │ │ │ │ │ ├── FeedbackRequiredException.php │ │ │ │ │ ├── ForcedPasswordResetException.php │ │ │ │ │ ├── IncorrectPasswordException.php │ │ │ │ │ ├── InstagramException.php │ │ │ │ │ ├── InternalException.php │ │ │ │ │ ├── InvalidUserException.php │ │ │ │ │ ├── LoginRequiredException.php │ │ │ │ │ ├── NetworkException.php │ │ │ │ │ ├── RequestException.php │ │ │ │ │ ├── SentryBlockException.php │ │ │ │ │ ├── ServerMessageThrower.php │ │ │ │ │ ├── SettingsException.php │ │ │ │ │ ├── ThrottledException.php │ │ │ │ │ └── UploadFailedException.php │ │ │ │ │ ├── ImageAutoResizer.php │ │ │ │ │ ├── Instagram.php │ │ │ │ │ ├── InstagramID.php │ │ │ │ │ ├── Request.php │ │ │ │ │ ├── Response.php │ │ │ │ │ ├── Response │ │ │ │ │ ├── ActivityNewsResponse.php │ │ │ │ │ ├── AddressBookResponse.php │ │ │ │ │ ├── AutoCompleteUserListResponse.php │ │ │ │ │ ├── ChallengeResponse.php │ │ │ │ │ ├── ChangePasswordResponse.php │ │ │ │ │ ├── CommentLikeUnlikeResponse.php │ │ │ │ │ ├── CommentResponse.php │ │ │ │ │ ├── ConfigureResponse.php │ │ │ │ │ ├── DeleteCommentResponse.php │ │ │ │ │ ├── DirectShareInboxResponse.php │ │ │ │ │ ├── DirectThreadResponse.php │ │ │ │ │ ├── DiscoverChannelsResponse.php │ │ │ │ │ ├── DiscoverTopLiveResponse.php │ │ │ │ │ ├── EditMediaResponse.php │ │ │ │ │ ├── ExploreResponse.php │ │ │ │ │ ├── ExposeResponse.php │ │ │ │ │ ├── FBLocationResponse.php │ │ │ │ │ ├── FBSearchResponse.php │ │ │ │ │ ├── FollowerAndFollowingResponse.php │ │ │ │ │ ├── FollowingRecentActivityResponse.php │ │ │ │ │ ├── FriendshipResponse.php │ │ │ │ │ ├── FriendshipsShowManyResponse.php │ │ │ │ │ ├── GeoMediaResponse.php │ │ │ │ │ ├── InsightsResponse.php │ │ │ │ │ ├── LikeFeedResponse.php │ │ │ │ │ ├── LocationFeedResponse.php │ │ │ │ │ ├── LocationResponse.php │ │ │ │ │ ├── LoginResponse.php │ │ │ │ │ ├── LogoutResponse.php │ │ │ │ │ ├── MediaCommentsResponse.php │ │ │ │ │ ├── MediaDeleteResponse.php │ │ │ │ │ ├── MediaInfoResponse.php │ │ │ │ │ ├── MediaInsightsResponse.php │ │ │ │ │ ├── MediaLikersResponse.php │ │ │ │ │ ├── MegaphoneLogResponse.php │ │ │ │ │ ├── Model │ │ │ │ │ │ ├── Args.php │ │ │ │ │ │ ├── Attribution.php │ │ │ │ │ │ ├── Broadcast.php │ │ │ │ │ │ ├── BroadcastItem.php │ │ │ │ │ │ ├── BroadcastOwner.php │ │ │ │ │ │ ├── Caption.php │ │ │ │ │ │ ├── CarouselMedia.php │ │ │ │ │ │ ├── Channel.php │ │ │ │ │ │ ├── Comment.php │ │ │ │ │ │ ├── Counts.php │ │ │ │ │ │ ├── Experiment.php │ │ │ │ │ │ ├── Explore.php │ │ │ │ │ │ ├── ExploreItem.php │ │ │ │ │ │ ├── FeedAysf.php │ │ │ │ │ │ ├── FriendshipStatus.php │ │ │ │ │ │ ├── GeoMedia.php │ │ │ │ │ │ ├── HdProfilePicUrlInfo.php │ │ │ │ │ │ ├── Image_Versions2.php │ │ │ │ │ │ ├── In.php │ │ │ │ │ │ ├── Inbox.php │ │ │ │ │ │ ├── Insights.php │ │ │ │ │ │ ├── Item.php │ │ │ │ │ │ ├── Link.php │ │ │ │ │ │ ├── Location.php │ │ │ │ │ │ ├── LocationItem.php │ │ │ │ │ │ ├── Media.php │ │ │ │ │ │ ├── MediaInsights.php │ │ │ │ │ │ ├── Param.php │ │ │ │ │ │ ├── Position.php │ │ │ │ │ │ ├── Reel.php │ │ │ │ │ │ ├── Related.php │ │ │ │ │ │ ├── SavedFeedItem.php │ │ │ │ │ │ ├── StaticStickers.php │ │ │ │ │ │ ├── Stickers.php │ │ │ │ │ │ ├── Stories.php │ │ │ │ │ │ ├── Story.php │ │ │ │ │ │ ├── StoryLocation.php │ │ │ │ │ │ ├── Subscription.php │ │ │ │ │ │ ├── SuggestedUsers.php │ │ │ │ │ │ ├── Suggestion.php │ │ │ │ │ │ ├── Tag.php │ │ │ │ │ │ ├── Thread.php │ │ │ │ │ │ ├── ThreadItem.php │ │ │ │ │ │ ├── ThreadItemMedia.php │ │ │ │ │ │ ├── ThreadLastSeenAt.php │ │ │ │ │ │ ├── TopLive.php │ │ │ │ │ │ ├── Tray.php │ │ │ │ │ │ ├── User.php │ │ │ │ │ │ ├── Users.php │ │ │ │ │ │ ├── Usertag.php │ │ │ │ │ │ ├── VideoVersions.php │ │ │ │ │ │ └── _Message.php │ │ │ │ │ ├── PendingInboxResponse.php │ │ │ │ │ ├── PopularFeedResponse.php │ │ │ │ │ ├── RankedRecipientsResponse.php │ │ │ │ │ ├── RecentRecipientsResponse.php │ │ │ │ │ ├── ReelsMediaResponse.php │ │ │ │ │ ├── ReelsTrayFeedResponse.php │ │ │ │ │ ├── ReportExploreMediaResponse.php │ │ │ │ │ ├── SaveAndUnsaveMedia.php │ │ │ │ │ ├── SavedFeedResponse.php │ │ │ │ │ ├── SearchTagResponse.php │ │ │ │ │ ├── SearchUserResponse.php │ │ │ │ │ ├── StickerAssetsResponse.php │ │ │ │ │ ├── SuggestedUsersResponse.php │ │ │ │ │ ├── SyncResponse.php │ │ │ │ │ ├── TagFeedResponse.php │ │ │ │ │ ├── TagInfoResponse.php │ │ │ │ │ ├── TagRelatedResponse.php │ │ │ │ │ ├── TimelineFeedResponse.php │ │ │ │ │ ├── UploadJobVideoResponse.php │ │ │ │ │ ├── UploadPhotoResponse.php │ │ │ │ │ ├── UploadVideoResponse.php │ │ │ │ │ ├── UserFeedResponse.php │ │ │ │ │ ├── UserInfoResponse.php │ │ │ │ │ ├── UserStoryFeedResponse.php │ │ │ │ │ ├── UsertagsResponse.php │ │ │ │ │ └── V2InboxResponse.php │ │ │ │ │ ├── Settings │ │ │ │ │ ├── Factory.php │ │ │ │ │ ├── Storage │ │ │ │ │ │ ├── File.php │ │ │ │ │ │ ├── Memcached.php │ │ │ │ │ │ └── MySQL.php │ │ │ │ │ ├── StorageHandler.php │ │ │ │ │ └── StorageInterface.php │ │ │ │ │ ├── Signatures.php │ │ │ │ │ └── Utils.php │ │ │ │ ├── netresearch │ │ │ │ └── jsonmapper │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── .travis.yml │ │ │ │ │ ├── ChangeLog │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── composer.json │ │ │ │ │ ├── example │ │ │ │ │ ├── Address.php │ │ │ │ │ ├── Contact.php │ │ │ │ │ ├── run.php │ │ │ │ │ └── single.json │ │ │ │ │ ├── package.xml │ │ │ │ │ ├── src │ │ │ │ │ ├── JsonMapper.php │ │ │ │ │ └── JsonMapper │ │ │ │ │ │ └── Exception.php │ │ │ │ │ └── tests │ │ │ │ │ ├── ArrayTest.php │ │ │ │ │ ├── JsonMapperTest │ │ │ │ │ ├── Array.php │ │ │ │ │ ├── Broken.php │ │ │ │ │ ├── DependencyInjector.php │ │ │ │ │ ├── Logger.php │ │ │ │ │ ├── Object.php │ │ │ │ │ ├── PHP7_Object.php │ │ │ │ │ ├── PlainObject.php │ │ │ │ │ ├── PrivateWithSetter.php │ │ │ │ │ ├── Simple.php │ │ │ │ │ └── ValueObject.php │ │ │ │ │ ├── ObjectTest.php │ │ │ │ │ ├── OtherTest.php │ │ │ │ │ ├── PHP7_ObjectTest.php │ │ │ │ │ ├── SimpleTest.php │ │ │ │ │ ├── bootstrap.php │ │ │ │ │ ├── namespacetest │ │ │ │ │ ├── NamespaceTest.php │ │ │ │ │ ├── Unit.php │ │ │ │ │ ├── UnitData.php │ │ │ │ │ └── model │ │ │ │ │ │ ├── MyArrayObject.php │ │ │ │ │ │ ├── User.php │ │ │ │ │ │ └── UserList.php │ │ │ │ │ ├── othernamespace │ │ │ │ │ └── Foo.php │ │ │ │ │ └── phpunit.xml │ │ │ │ └── psr │ │ │ │ └── http-message │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── composer.json │ │ │ │ └── src │ │ │ │ ├── MessageInterface.php │ │ │ │ ├── RequestInterface.php │ │ │ │ ├── ResponseInterface.php │ │ │ │ ├── ServerRequestInterface.php │ │ │ │ ├── StreamInterface.php │ │ │ │ ├── UploadedFileInterface.php │ │ │ │ └── UriInterface.php │ │ └── savedStatus │ │ │ ├── comments.json │ │ │ └── userinformation.json │ ├── Scheduling │ │ ├── HumanScheduler.py │ │ ├── SleepJob.py │ │ └── __init__.py │ ├── StatusReport.py │ ├── Tasks │ │ ├── InstaPySession.py │ │ ├── Sleep.py │ │ ├── Task.py │ │ ├── UploadImage.py │ │ └── __init__.py │ └── __init__.py ├── __init__.py ├── assets │ └── unicodes.md ├── logs │ ├── followRestriction.json │ ├── followed.txt │ ├── followerNum.txt │ ├── logFile.txt │ └── run.txt ├── main.py ├── phpapi │ ├── comments.php │ ├── composer.json │ ├── relatedTags.php │ ├── statistics.php │ └── uploadImage.php ├── remoteExec.py ├── savedStatus │ ├── comments.json │ ├── filetokeepfolderalive │ └── userinformation.json ├── static │ ├── app.css │ ├── app.css.map │ ├── app.js │ ├── app.scss │ └── index.html └── test.py ├── config.json ├── dashboard ├── LICENSE ├── README.md ├── dashboard-img.png ├── index.js ├── package-lock.json ├── package.json └── public │ ├── app.css │ ├── app.css.map │ ├── app.js │ ├── app.scss │ ├── index.html │ └── social-bot-logo.png ├── docker-compose.yml ├── installdebianvm.sh ├── linuxsetup.sh └── macsetup /.gitignore: -------------------------------------------------------------------------------- 1 | #Own stuff 2 | */*.jpg 3 | dashbaord/node_modules/ 4 | 5 | instabot/phpapi/composer.lock 6 | instabot/phpapi/vendor 7 | instabot/savedStatus/hashtags.json 8 | instabot/savedStatus/images.json 9 | instabot/savedStatus/blacklist.json 10 | 11 | .idea/workspace.xml 12 | #Predefined python stuff... 13 | # Byte-compiled / optimized / DLL files 14 | __pycache__/ 15 | *.py[cod] 16 | *$py.class 17 | 18 | # C extensions 19 | *.so 20 | 21 | # Distribution / packaging 22 | .Python 23 | env/ 24 | build/ 25 | develop-eggs/ 26 | dist/ 27 | downloads/ 28 | eggs/ 29 | .eggs/ 30 | lib/ 31 | lib64/ 32 | parts/ 33 | sdist/ 34 | var/ 35 | wheels/ 36 | *.egg-info/ 37 | .installed.cfg 38 | *.egg 39 | 40 | # PyInstaller 41 | # Usually these files are written by a python script from a template 42 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 43 | *.manifest 44 | *.spec 45 | 46 | # Installer logs 47 | pip-log.txt 48 | pip-delete-this-directory.txt 49 | 50 | # Unit test / coverage reports 51 | htmlcov/ 52 | .tox/ 53 | .coverage 54 | .coverage.* 55 | .cache 56 | nosetests.xml 57 | coverage.xml 58 | *.cover 59 | .hypothesis/ 60 | 61 | # Translations 62 | *.mo 63 | *.pot 64 | 65 | # Django stuff: 66 | *.log 67 | local_settings.py 68 | 69 | # Flask stuff: 70 | instance/ 71 | .webassets-cache 72 | 73 | # Scrapy stuff: 74 | .scrapy 75 | 76 | # Sphinx documentation 77 | docs/_build/ 78 | 79 | # PyBuilder 80 | target/ 81 | 82 | # Jupyter Notebook 83 | .ipynb_checkpoints 84 | 85 | # pyenv 86 | .python-version 87 | 88 | # celery beat schedule file 89 | celerybeat-schedule 90 | 91 | # SageMath parsed files 92 | *.sage.py 93 | 94 | # dotenv 95 | .env 96 | 97 | # virtualenv 98 | .venv 99 | venv/ 100 | ENV/ 101 | 102 | # Spyder project settings 103 | .spyderproject 104 | .spyproject 105 | 106 | # Rope project settings 107 | .ropeproject 108 | 109 | # mkdocs documentation 110 | /site 111 | 112 | # mypy 113 | .mypy_cache/ 114 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "app/Services/Tasks/InstaPy"] 2 | path = app/Services/Tasks/InstaPy 3 | url = https://github.com/MoritzGruber/InstaPy.git 4 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/instabot.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM moritzgruber/instabotcontainer 2 | 3 | MAINTAINER Moritz Gruber 4 | 5 | 6 | COPY ./ ./ 7 | WORKDIR /instabot/phpapi/ 8 | RUN composer install 9 | 10 | WORKDIR /instabot/ 11 | 12 | RUN git clone https://github.com/MoritzGruber/InstaPy.git ./Services/Tasks/InstaPy 13 | CMD ["python", "main.py"] 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Moritz Gruber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/Services/Content/Comments.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import json 3 | 4 | # import sys 5 | # topic = sys.argv[1] 6 | # maxpp = sys.argv[2] 7 | # num = sys.argv[3] 8 | 9 | def getComments(topic, maxpp, num): 10 | information = subprocess.check_output(["php", "phpapi/comments.php", str(topic), str(maxpp), str(num)]).decode('unicode-escape').encode('latin1').decode('utf8') 11 | data = {} 12 | data['topic'] = topic 13 | data['maxpp'] = maxpp 14 | data['num'] = num 15 | data['comments'] = information 16 | return json.dumps(data, ensure_ascii=False) 17 | 18 | def getCommentsSaveToFile(topic, maxpp, num): 19 | data = getComments(topic, maxpp, num) 20 | with open('savedStatus/comments.json', 'w') as f: 21 | json.dump(data, f) 22 | #open file 23 | # fh = open('phpapi/resources/comments.json', 'r') 24 | # # if file does not exist, create it 25 | # if not fh: 26 | # fh = open('phpapi/resources/comments.json', "w") 27 | # 28 | # with open('phpapi/resources/comments.json', 'a') as f: 29 | # f.write("\n") 30 | # f.write("\n") 31 | # f.write(json.dumps(data).decode('unicode-escape').encode('utf8')) 32 | # 33 | # print('..results added to phpapi/resources/comments.json file.') 34 | 35 | return data 36 | 37 | def getUnicodeCommentsSaveToFile(topic, maxpp, num): 38 | comments = getComments(topic, maxpp, num) 39 | 40 | data = {}; 41 | data['topic'] = topic; 42 | data['maxpp'] = maxpp; 43 | data['num'] = num; 44 | 45 | data['comments'] = comments; 46 | 47 | # open file 48 | fh = open('savedStatus/comments.json', 'r') 49 | 50 | # if file does not exist, create it 51 | if not fh: 52 | fh = open('savedStatus/comments.json', "w") 53 | 54 | with open('savedStatus/comments.json', 'a') as f: 55 | f.write("\n") 56 | f.write("\n") 57 | f.write(json.dumps(data).decode('unicode-escape').encode('utf8')) 58 | 59 | print('..results added to phpapi/savedStatus/comments.json file.') 60 | 61 | return data -------------------------------------------------------------------------------- /app/Services/Content/Hashtags.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import json 3 | import time 4 | import sys 5 | 6 | 7 | def generate(tag, amount): 8 | """This function generates a specific number of tags relataed to one main tag""" 9 | setOfTags = set() 10 | 11 | setOfTags.add("#" + tag) 12 | 13 | # for _ in range(int(sys.argv[2])): 14 | def search(): 15 | tmpNextSet = setOfTags.copy() 16 | while (True): 17 | # 1 18 | for tag in tmpNextSet: 19 | time.sleep(0.1) 20 | relatedTags = subprocess.check_output(["php", "phpapi/relatedTags.php", tag[1:]]).decode('utf8') 21 | relatedTags = str(relatedTags) 22 | if('omething went wrong' in relatedTags): 23 | print ('sth went wrong, waiting a 300 millsec') 24 | time.sleep(0.3) 25 | continue 26 | arrayOfTags = str.split(relatedTags) 27 | print (relatedTags) 28 | for element in arrayOfTags: 29 | setOfTags.add("#" + element) 30 | percentage = ((float(setOfTags.__len__()) / float(amount)) * 100) 31 | print("Status: " + "{:.0f}".format(percentage) + "% - " + str(setOfTags.__len__()) + "/" + str( 32 | amount) + " Hashtags") 33 | if setOfTags.__len__() >= int(amount): 34 | print('Done') 35 | return 36 | sys.stdout.write("\033[F") 37 | # 5 +1 38 | tmpNextSet = setOfTags - tmpNextSet 39 | 40 | # tmpNextSet = bla.copy() 41 | # 5 42 | 43 | search() 44 | 45 | class SetEncoder(json.JSONEncoder): 46 | def default(self, obj): 47 | if isinstance(obj, set): 48 | return list(obj) 49 | return json.JSONEncoder.default(self, obj) 50 | 51 | with open('savedStatus/hashtags.json', 'w') as f: 52 | json.dump(setOfTags, f, cls=SetEncoder) 53 | print('Results saved to hashtags.json file') 54 | blob = json.dumps(setOfTags, cls=SetEncoder) 55 | print (blob) 56 | return blob 57 | -------------------------------------------------------------------------------- /app/Services/Content/Images.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | 4 | 5 | def generate(tag): 6 | """This function saves all avaliable images on the pexles api to savedStatus/images.json file""" 7 | 8 | headers = {"Authorization": "563492ad6f917000010000010f2f5d08c1564ccb66bf4ddebe906a0a"} 9 | 10 | requestResult = requests.get('http://api.pexels.com/v1/search?query=' + tag + '&per_page=40&page=1', 11 | headers=headers) 12 | 13 | jsonResult = json.loads(requestResult.text) 14 | 15 | jsonToSave = json.loads("{}") 16 | 17 | jsonToSave['total_results'] = jsonResult['total_results'] 18 | jsonToSave['photos'] = [] 19 | numberOfPageesNeeded = int((jsonResult['total_results']) / 40 + 1) 20 | 21 | print ('Found ' + str(jsonResult['total_results']) + ' images') 22 | print (str(numberOfPageesNeeded + 1) + ' api calls used form 200/h') 23 | 24 | for pageNumber in range(numberOfPageesNeeded): 25 | requestResult = requests.get( 26 | 'http://api.pexels.com/v1/search?query=' + tag + '&per_page=40&page=' + str( 27 | pageNumber), headers=headers) 28 | for photo in jsonResult['photos']: 29 | jsonToSave['photos'].append({"id": photo['id'], "src": photo['src']['square']}) 30 | 31 | with open('savedStatus/images.json', 'w') as f: 32 | json.dump(jsonToSave, f) 33 | 34 | 35 | def generate_onepage(tag): 36 | 37 | 38 | headers = {"Authorization": "563492ad6f917000010000010f2f5d08c1564ccb66bf4ddebe906a0a"} 39 | 40 | requestResult = requests.get('http://api.pexels.com/v1/search?query=' + tag + '&per_page=40&page=1', 41 | headers=headers) 42 | 43 | jsonResult = json.loads(requestResult.text) 44 | 45 | jsonToSave = json.loads("{}") 46 | 47 | jsonToSave['total_results'] = jsonResult['total_results'] 48 | jsonToSave['photos'] = [] 49 | numberOfPageesNeeded = 1 50 | 51 | print ('Found ' + str(jsonResult['total_results']) + ' images') 52 | print (str(numberOfPageesNeeded + 1) + ' api calls used form 200/h') 53 | 54 | for pageNumber in range(numberOfPageesNeeded): 55 | requestResult = requests.get( 56 | 'http://api.pexels.com/v1/search?query=' + tag + '&per_page=40&page=' + str( 57 | pageNumber), headers=headers) 58 | for photo in jsonResult['photos']: 59 | jsonToSave['photos'].append({"id": photo['id'], "src": photo['src']['square']}) 60 | 61 | return json.dumps(jsonToSave) -------------------------------------------------------------------------------- /app/Services/Content/Statistics.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | # import sys 4 | # 5 | # information = None 6 | # username = sys.argv[1] 7 | 8 | def getUserInformation(username): 9 | # global information 10 | information = str(subprocess.check_output(["php", "phpapi/statistics.php", username]).decode('utf-8')) 11 | # print("\n") 12 | print(information) 13 | # print("\n") 14 | 15 | fileAleadyExit = os.path.isfile('savedStatus/userinformation.json') 16 | with open('savedStatus/userinformation.json', 'a') as f: 17 | if fileAleadyExit: 18 | f.write("\n") 19 | f.write("\n") 20 | f.write(information) 21 | 22 | # print('..results added to phpapi/resources/userinformation.json file.') 23 | 24 | return information 25 | 26 | # getUserInformation() 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/Services/Content/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/Services/Content/__init__.py -------------------------------------------------------------------------------- /app/Services/Content/grab-comments.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | from Comments import getUnicodeCommentsSaveToFile 4 | 5 | import sys 6 | 7 | topic = sys.argv[1] 8 | maxpp = sys.argv[2] 9 | num = sys.argv[3] 10 | 11 | getUnicodeCommentsSaveToFile(topic, maxpp, num) -------------------------------------------------------------------------------- /app/Services/Content/grab-statistics.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | from Statistics import getUserInformation 4 | 5 | import sys 6 | 7 | username = sys.argv[1] 8 | 9 | getUserInformation(username) -------------------------------------------------------------------------------- /app/Services/Content/phpapi/comments.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 20 | $ig->login(); 21 | } catch (\Exception $e) { 22 | echo 'Something went wrong: '.$e->getMessage()."\n"; 23 | exit(0); 24 | } 25 | 26 | try { 27 | 28 | /*if ( 0 == filesize( $file_path ) ) 29 | { 30 | // file is empty 31 | 32 | $count = 1; 33 | foreach ($fields as $value) 34 | { 35 | echo $value; 36 | 37 | if (count($fields) != $count) echo ","; 38 | else echo "\r\n"; 39 | 40 | $count = $count + 1; 41 | } 42 | }*/ 43 | 44 | $tagsResult = $ig->getHashtagFeed($topic); 45 | $tags = $tagsResult->ranked_items; 46 | 47 | // array_values($tags)[0]; 48 | 49 | // echo "Results: " . $tagsResult->num_results . ",\r\n"; 50 | // echo $topic . ",\r\n"; 51 | // echo array_values($tags)[0]->name; 52 | 53 | $results = array(); 54 | 55 | foreach ($tags as $value) 56 | { 57 | $commentsResp = $ig->getMediaComments($value->id); 58 | $comments = $commentsResp->comments; 59 | if ($commentsResp->comment_count > 0) { 60 | 61 | $imgCommentCounter = 0; 62 | foreach ($comments as $comment) 63 | { 64 | if (count($results) < $num) { 65 | if ($imgCommentCounter < $maxpp) { 66 | $commentText = $comment->text; 67 | $results[] = $commentText; 68 | $imgCommentCounter = $imgCommentCounter + 1; 69 | } else { 70 | break; 71 | } 72 | } else { 73 | echo json_encode($results,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); 74 | echo "\r\n"; 75 | return; 76 | } 77 | } 78 | } 79 | } 80 | 81 | echo json_encode($results,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); 82 | echo "\r\n"; 83 | } catch (\Exception $e) { 84 | echo 'Something went wrong: '.$e->getMessage()."\n"; 85 | } -------------------------------------------------------------------------------- /app/Services/Content/phpapi/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "mgp25/instagram-php": "^2.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/composer.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/Services/Content/phpapi/composer.phar -------------------------------------------------------------------------------- /app/Services/Content/phpapi/resources/userinformation.json: -------------------------------------------------------------------------------- 1 | {"timestamp":1497304090,"username":"bobobo","follower_count":198,"following_count":0,"media_count":0,"usertags_count":28,"feed_items":0,"likes":0,"comments":0}{"timestamp":1497304094,"username":"david452","follower_count":67,"following_count":117,"media_count":5,"usertags_count":2,"feed_items":5,"likes":99,"comments":4}{"timestamp":1497304098,"username":"tr3ndfood","follower_count":45,"following_count":77,"media_count":10,"usertags_count":0,"feed_items":10,"likes":434,"comments":10} 2 | 3 | {"timestamp":1497304127,"username":"tr3ndfood","follower_count":45,"following_count":77,"media_count":10,"usertags_count":0,"feed_items":10,"likes":434,"comments":10} 4 | 5 | {"timestamp":1497304132,"username":"tr3ndfood","follower_count":45,"following_count":77,"media_count":10,"usertags_count":0,"feed_items":10,"likes":434,"comments":10} 6 | 7 | {"timestamp":1497304136,"username":"david452","follower_count":67,"following_count":117,"media_count":5,"usertags_count":2,"feed_items":5,"likes":99,"comments":4} 8 | 9 | {"timestamp":1497304142,"username":"bobobo","follower_count":198,"following_count":0,"media_count":0,"usertags_count":28,"feed_items":0,"likes":0,"comments":0} 10 | 11 | {"timestamp":1497304204,"username":"runbaba","follower_count":0,"following_count":0,"media_count":1,"usertags_count":0,"feed_items":1,"likes":0,"comments":0} -------------------------------------------------------------------------------- /app/Services/Content/phpapi/statistics.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 19 | $ig->login(); 20 | } catch (\Exception $e) { 21 | echo 'Something went wrong: '.$e->getMessage()."\n"; 22 | exit(0); 23 | } 24 | 25 | try { 26 | 27 | $obj = array(); 28 | 29 | $user = $ig->getUserInfoByName($targetname); 30 | $userid = $user->user->pk; 31 | $feed = $ig->getUserFeed($userid); 32 | $feed_items = $feed->items; 33 | 34 | $likes = 0; 35 | $comments = 0; 36 | 37 | $obj["timestamp"] = time(); 38 | $obj["username"] = $user->user->username; 39 | $obj["follower_count"] = $user->user->follower_count; 40 | $obj["following_count"] = $user->user->following_count; 41 | $obj["media_count"] = $user->user->media_count; 42 | $obj["usertags_count"] = $user->user->usertags_count; 43 | $obj["feed_items"] = count($feed->items); 44 | 45 | do 46 | { 47 | foreach ($feed_items as $value) 48 | { 49 | $likes = $likes + $value->like_count; 50 | $comments = $comments + $value->comment_count; 51 | } 52 | 53 | if ($feed->more_available) 54 | { 55 | $feed = $ig->getUserFeed($userid, $feed->next_max_id); 56 | $feed_items = $feed->items; 57 | } 58 | } while ($feed->more_available); 59 | 60 | $obj["likes"] = $likes; 61 | $obj["comments"] = $comments; 62 | 63 | echo json_encode($obj); 64 | } catch (\Exception $e) { 65 | echo 'Something went wrong: '.$e->getMessage()."\n"; 66 | } 67 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 10 | 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 11 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 12 | ); 13 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/netresearch/jsonmapper/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/psr/http-message/src'), 10 | 'InstagramAPI\\' => array($vendorDir . '/mgp25/instagram-php/src'), 11 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 12 | 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 13 | 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 14 | ); 15 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | $path) { 28 | $loader->set($namespace, $path); 29 | } 30 | 31 | $map = require __DIR__ . '/autoload_psr4.php'; 32 | foreach ($map as $namespace => $path) { 33 | $loader->setPsr4($namespace, $path); 34 | } 35 | 36 | $classMap = require __DIR__ . '/autoload_classmap.php'; 37 | if ($classMap) { 38 | $loader->addClassMap($classMap); 39 | } 40 | 41 | $loader->register(true); 42 | 43 | $includeFiles = require __DIR__ . '/autoload_files.php'; 44 | foreach ($includeFiles as $fileIdentifier => $file) { 45 | composerRequire9518ac69cef05b36ff59d4c7d084a250($fileIdentifier, $file); 46 | } 47 | 48 | return $loader; 49 | } 50 | } 51 | 52 | function composerRequire9518ac69cef05b36ff59d4c7d084a250($fileIdentifier, $file) 53 | { 54 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 55 | require $file; 56 | 57 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 11 | 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', 12 | '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', 13 | ); 14 | 15 | public static $prefixLengthsPsr4 = array ( 16 | 'P' => 17 | array ( 18 | 'Psr\\Http\\Message\\' => 17, 19 | ), 20 | 'I' => 21 | array ( 22 | 'InstagramAPI\\' => 13, 23 | ), 24 | 'G' => 25 | array ( 26 | 'GuzzleHttp\\Psr7\\' => 16, 27 | 'GuzzleHttp\\Promise\\' => 19, 28 | 'GuzzleHttp\\' => 11, 29 | ), 30 | ); 31 | 32 | public static $prefixDirsPsr4 = array ( 33 | 'Psr\\Http\\Message\\' => 34 | array ( 35 | 0 => __DIR__ . '/..' . '/psr/http-message/src', 36 | ), 37 | 'InstagramAPI\\' => 38 | array ( 39 | 0 => __DIR__ . '/..' . '/mgp25/instagram-php/src', 40 | ), 41 | 'GuzzleHttp\\Psr7\\' => 42 | array ( 43 | 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', 44 | ), 45 | 'GuzzleHttp\\Promise\\' => 46 | array ( 47 | 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', 48 | ), 49 | 'GuzzleHttp\\' => 50 | array ( 51 | 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', 52 | ), 53 | ); 54 | 55 | public static $prefixesPsr0 = array ( 56 | 'J' => 57 | array ( 58 | 'JsonMapper' => 59 | array ( 60 | 0 => __DIR__ . '/..' . '/netresearch/jsonmapper/src', 61 | ), 62 | ), 63 | ); 64 | 65 | public static function getInitializer(ClassLoader $loader) 66 | { 67 | return \Closure::bind(function () use ($loader) { 68 | $loader->prefixLengthsPsr4 = ComposerStaticInit9518ac69cef05b36ff59d4c7d084a250::$prefixLengthsPsr4; 69 | $loader->prefixDirsPsr4 = ComposerStaticInit9518ac69cef05b36ff59d4c7d084a250::$prefixDirsPsr4; 70 | $loader->prefixesPsr0 = ComposerStaticInit9518ac69cef05b36ff59d4c7d084a250::$prefixesPsr0; 71 | 72 | }, null, ClassLoader::class); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | sudo: false 4 | 5 | php: 6 | - 5.5 7 | - 5.6 8 | - 7.0 9 | - 7.1 10 | - hhvm 11 | 12 | before_script: 13 | - curl --version 14 | - composer install --no-interaction --prefer-source --dev 15 | - ~/.nvm/nvm.sh install v0.6.14 16 | - ~/.nvm/nvm.sh run v0.6.14 17 | - '[ "$TRAVIS_PHP_VERSION" != "7.0" ] || echo "xdebug.overload_var_dump = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini' 18 | 19 | script: make test 20 | 21 | matrix: 22 | allow_failures: 23 | - php: hhvm 24 | fast_finish: true 25 | 26 | before_deploy: 27 | - rvm 1.9.3 do gem install mime-types -v 2.6.2 28 | - make package 29 | 30 | deploy: 31 | provider: releases 32 | api_key: 33 | secure: UpypqlYgsU68QT/x40YzhHXvzWjFwCNo9d+G8KAdm7U9+blFfcWhV1aMdzugvPMl6woXgvJj7qHq5tAL4v6oswCORhpSBfLgOQVFaica5LiHsvWlAedOhxGmnJqMTwuepjBCxXhs3+I8Kof1n4oUL9gKytXjOVCX/f7XU1HiinU= 34 | file: 35 | - build/artifacts/guzzle.phar 36 | - build/artifacts/guzzle.zip 37 | on: 38 | repo: guzzle/guzzle 39 | tags: true 40 | all_branches: true 41 | php: 5.5 42 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 Michael Dowling, https://github.com/mtdowling 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/guzzle", 3 | "type": "library", 4 | "description": "Guzzle is a PHP HTTP client library", 5 | "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"], 6 | "homepage": "http://guzzlephp.org/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Michael Dowling", 11 | "email": "mtdowling@gmail.com", 12 | "homepage": "https://github.com/mtdowling" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.5", 17 | "guzzlehttp/psr7": "^1.4", 18 | "guzzlehttp/promises": "^1.0" 19 | }, 20 | "require-dev": { 21 | "ext-curl": "*", 22 | "phpunit/phpunit": "^4.0", 23 | "psr/log": "^1.0" 24 | }, 25 | "autoload": { 26 | "files": ["src/functions_include.php"], 27 | "psr-4": { 28 | "GuzzleHttp\\": "src/" 29 | } 30 | }, 31 | "autoload-dev": { 32 | "psr-4": { 33 | "GuzzleHttp\\Tests\\": "tests/" 34 | } 35 | }, 36 | "extra": { 37 | "branch-alias": { 38 | "dev-master": "6.2-dev" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php: -------------------------------------------------------------------------------- 1 | sessionKey = $sessionKey; 26 | $this->storeSessionCookies = $storeSessionCookies; 27 | $this->load(); 28 | } 29 | 30 | /** 31 | * Saves cookies to session when shutting down 32 | */ 33 | public function __destruct() 34 | { 35 | $this->save(); 36 | } 37 | 38 | /** 39 | * Save cookies to the client session 40 | */ 41 | public function save() 42 | { 43 | $json = []; 44 | foreach ($this as $cookie) { 45 | /** @var SetCookie $cookie */ 46 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { 47 | $json[] = $cookie->toArray(); 48 | } 49 | } 50 | 51 | $_SESSION[$this->sessionKey] = json_encode($json); 52 | } 53 | 54 | /** 55 | * Load the contents of the client session into the data array 56 | */ 57 | protected function load() 58 | { 59 | if (!isset($_SESSION[$this->sessionKey])) { 60 | return; 61 | } 62 | $data = json_decode($_SESSION[$this->sessionKey], true); 63 | if (is_array($data)) { 64 | foreach ($data as $cookie) { 65 | $this->setCookie(new SetCookie($cookie)); 66 | } 67 | } elseif (strlen($data)) { 68 | throw new \RuntimeException("Invalid cookie data"); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 16 | $msg = $msg ?: 'Could not seek the stream to position ' . $pos; 17 | parent::__construct($msg); 18 | } 19 | 20 | /** 21 | * @return StreamInterface 22 | */ 23 | public function getStream() 24 | { 25 | return $this->stream; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php: -------------------------------------------------------------------------------- 1 | factory = isset($options['handle_factory']) 29 | ? $options['handle_factory'] 30 | : new CurlFactory(3); 31 | } 32 | 33 | public function __invoke(RequestInterface $request, array $options) 34 | { 35 | if (isset($options['delay'])) { 36 | usleep($options['delay'] * 1000); 37 | } 38 | 39 | $easy = $this->factory->create($request, $options); 40 | curl_exec($easy->handle); 41 | $easy->errno = curl_errno($easy->handle); 42 | 43 | return CurlFactory::finish($this, $easy, $this->factory); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/Makefile: -------------------------------------------------------------------------------- 1 | all: clean test 2 | 3 | test: 4 | vendor/bin/phpunit 5 | 6 | coverage: 7 | vendor/bin/phpunit --coverage-html=artifacts/coverage 8 | 9 | view-coverage: 10 | open artifacts/coverage/index.html 11 | 12 | clean: 13 | rm -rf artifacts/* 14 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/promises", 3 | "description": "Guzzle promises library", 4 | "keywords": ["promise"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Michael Dowling", 9 | "email": "mtdowling@gmail.com", 10 | "homepage": "https://github.com/mtdowling" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.5.0" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "^4.0" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "GuzzleHttp\\Promise\\": "src/" 22 | }, 23 | "files": ["src/functions_include.php"] 24 | }, 25 | "scripts": { 26 | "test": "vendor/bin/phpunit", 27 | "test-ci": "vendor/bin/phpunit --coverage-text" 28 | }, 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.4-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/src/AggregateException.php: -------------------------------------------------------------------------------- 1 | value = $value; 22 | } 23 | 24 | public function then( 25 | callable $onFulfilled = null, 26 | callable $onRejected = null 27 | ) { 28 | // Return itself if there is no onFulfilled function. 29 | if (!$onFulfilled) { 30 | return $this; 31 | } 32 | 33 | $queue = queue(); 34 | $p = new Promise([$queue, 'run']); 35 | $value = $this->value; 36 | $queue->add(static function () use ($p, $value, $onFulfilled) { 37 | if ($p->getState() === self::PENDING) { 38 | try { 39 | $p->resolve($onFulfilled($value)); 40 | } catch (\Throwable $e) { 41 | $p->reject($e); 42 | } catch (\Exception $e) { 43 | $p->reject($e); 44 | } 45 | } 46 | }); 47 | 48 | return $p; 49 | } 50 | 51 | public function otherwise(callable $onRejected) 52 | { 53 | return $this->then(null, $onRejected); 54 | } 55 | 56 | public function wait($unwrap = true, $defaultDelivery = null) 57 | { 58 | return $unwrap ? $this->value : null; 59 | } 60 | 61 | public function getState() 62 | { 63 | return self::FULFILLED; 64 | } 65 | 66 | public function resolve($value) 67 | { 68 | if ($value !== $this->value) { 69 | throw new \LogicException("Cannot resolve a fulfilled promise"); 70 | } 71 | } 72 | 73 | public function reject($reason) 74 | { 75 | throw new \LogicException("Cannot reject a fulfilled promise"); 76 | } 77 | 78 | public function cancel() 79 | { 80 | // pass 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/src/PromisorInterface.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 22 | } 23 | 24 | public function then( 25 | callable $onFulfilled = null, 26 | callable $onRejected = null 27 | ) { 28 | // If there's no onRejected callback then just return self. 29 | if (!$onRejected) { 30 | return $this; 31 | } 32 | 33 | $queue = queue(); 34 | $reason = $this->reason; 35 | $p = new Promise([$queue, 'run']); 36 | $queue->add(static function () use ($p, $reason, $onRejected) { 37 | if ($p->getState() === self::PENDING) { 38 | try { 39 | // Return a resolved promise if onRejected does not throw. 40 | $p->resolve($onRejected($reason)); 41 | } catch (\Throwable $e) { 42 | // onRejected threw, so return a rejected promise. 43 | $p->reject($e); 44 | } catch (\Exception $e) { 45 | // onRejected threw, so return a rejected promise. 46 | $p->reject($e); 47 | } 48 | } 49 | }); 50 | 51 | return $p; 52 | } 53 | 54 | public function otherwise(callable $onRejected) 55 | { 56 | return $this->then(null, $onRejected); 57 | } 58 | 59 | public function wait($unwrap = true, $defaultDelivery = null) 60 | { 61 | if ($unwrap) { 62 | throw exception_for($this->reason); 63 | } 64 | } 65 | 66 | public function getState() 67 | { 68 | return self::REJECTED; 69 | } 70 | 71 | public function resolve($value) 72 | { 73 | throw new \LogicException("Cannot resolve a rejected promise"); 74 | } 75 | 76 | public function reject($reason) 77 | { 78 | if ($reason !== $this->reason) { 79 | throw new \LogicException("Cannot reject a rejected promise"); 80 | } 81 | } 82 | 83 | public function cancel() 84 | { 85 | // pass 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/src/RejectionException.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 21 | 22 | $message = 'The promise was rejected'; 23 | 24 | if ($description) { 25 | $message .= ' with reason: ' . $description; 26 | } elseif (is_string($reason) 27 | || (is_object($reason) && method_exists($reason, '__toString')) 28 | ) { 29 | $message .= ' with reason: ' . $this->reason; 30 | } elseif ($reason instanceof \JsonSerializable) { 31 | $message .= ' with reason: ' 32 | . json_encode($this->reason, JSON_PRETTY_PRINT); 33 | } 34 | 35 | parent::__construct($message); 36 | } 37 | 38 | /** 39 | * Returns the rejection reason. 40 | * 41 | * @return mixed 42 | */ 43 | public function getReason() 44 | { 45 | return $this->reason; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/src/TaskQueue.php: -------------------------------------------------------------------------------- 1 | run(); 12 | */ 13 | class TaskQueue implements TaskQueueInterface 14 | { 15 | private $enableShutdown = true; 16 | private $queue = []; 17 | 18 | public function __construct($withShutdown = true) 19 | { 20 | if ($withShutdown) { 21 | register_shutdown_function(function () { 22 | if ($this->enableShutdown) { 23 | // Only run the tasks if an E_ERROR didn't occur. 24 | $err = error_get_last(); 25 | if (!$err || ($err['type'] ^ E_ERROR)) { 26 | $this->run(); 27 | } 28 | } 29 | }); 30 | } 31 | } 32 | 33 | public function isEmpty() 34 | { 35 | return !$this->queue; 36 | } 37 | 38 | public function add(callable $task) 39 | { 40 | $this->queue[] = $task; 41 | } 42 | 43 | public function run() 44 | { 45 | /** @var callable $task */ 46 | while ($task = array_shift($this->queue)) { 47 | $task(); 48 | } 49 | } 50 | 51 | /** 52 | * The task queue will be run and exhausted by default when the process 53 | * exits IFF the exit is not the result of a PHP E_ERROR error. 54 | * 55 | * You can disable running the automatic shutdown of the queue by calling 56 | * this function. If you disable the task queue shutdown process, then you 57 | * MUST either run the task queue (as a result of running your event loop 58 | * or manually using the run() method) or wait on each outstanding promise. 59 | * 60 | * Note: This shutdown will occur before any destructors are triggered. 61 | */ 62 | public function disableShutdown() 63 | { 64 | $this->enableShutdown = false; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/promises/src/TaskQueueInterface.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/psr7/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/psr7", 3 | "type": "library", 4 | "description": "PSR-7 message implementation that also provides common utility methods", 5 | "keywords": ["request", "response", "message", "stream", "http", "uri", "url"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Michael Dowling", 10 | "email": "mtdowling@gmail.com", 11 | "homepage": "https://github.com/mtdowling" 12 | }, 13 | { 14 | "name": "Tobias Schultze", 15 | "homepage": "https://github.com/Tobion" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "psr/http-message": "~1.0" 21 | }, 22 | "require-dev": { 23 | "phpunit/phpunit": "~4.0" 24 | }, 25 | "provide": { 26 | "psr/http-message-implementation": "1.0" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "GuzzleHttp\\Psr7\\": "src/" 31 | }, 32 | "files": ["src/functions_include.php"] 33 | }, 34 | "extra": { 35 | "branch-alias": { 36 | "dev-master": "1.4-dev" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/psr7/src/DroppingStream.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 23 | $this->maxLength = $maxLength; 24 | } 25 | 26 | public function write($string) 27 | { 28 | $diff = $this->maxLength - $this->stream->getSize(); 29 | 30 | // Begin returning 0 when the underlying stream is too large. 31 | if ($diff <= 0) { 32 | return 0; 33 | } 34 | 35 | // Write the stream or a subset of the stream if needed. 36 | if (strlen($string) < $diff) { 37 | return $this->stream->write($string); 38 | } 39 | 40 | return $this->stream->write(substr($string, 0, $diff)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/psr7/src/InflateStream.php: -------------------------------------------------------------------------------- 1 | read(10); 25 | $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); 26 | // Skip the header, that is 10 + length of filename + 1 (nil) bytes 27 | $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); 28 | $resource = StreamWrapper::getResource($stream); 29 | stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); 30 | $this->stream = new Stream($resource); 31 | } 32 | 33 | /** 34 | * @param StreamInterface $stream 35 | * @param $header 36 | * @return int 37 | */ 38 | private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) 39 | { 40 | $filename_header_length = 0; 41 | 42 | if (substr(bin2hex($header), 6, 2) === '08') { 43 | // we have a filename, read until nil 44 | $filename_header_length = 1; 45 | while ($stream->read(1) !== chr(0)) { 46 | $filename_header_length++; 47 | } 48 | } 49 | 50 | return $filename_header_length; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/psr7/src/LazyOpenStream.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 27 | $this->mode = $mode; 28 | } 29 | 30 | /** 31 | * Creates the underlying stream lazily when required. 32 | * 33 | * @return StreamInterface 34 | */ 35 | protected function createStream() 36 | { 37 | return stream_for(try_fopen($this->filename, $this->mode)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/guzzlehttp/psr7/src/NoSeekStream.php: -------------------------------------------------------------------------------- 1 | =5.6", 36 | "guzzlehttp/guzzle": "^6.2", 37 | "ext-curl": "*", 38 | "ext-gd": "*", 39 | "ext-exif": "*" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/devtools/README.md: -------------------------------------------------------------------------------- 1 | These resources are *ONLY for INTERNAL usage* by the Instagram-API library developer team. 2 | 3 | Do *NOT* ask us about them. Do *NOT* make support tickets about them. We will *ban* you. 4 | 5 | Using this library is a *privilege* and we do *not* have to explain everything to every newbie who stumbles upon our repository. 6 | 7 | If you want to join the team, then read for yourself what they do and try to figure it out on your own. 8 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/devtools/exceptionTest.php: -------------------------------------------------------------------------------- 1 | ['login_required'], 16 | 'InstagramAPI\\Exception\\FeedbackRequiredException' => ['feedback_required'], 17 | 'InstagramAPI\\Exception\\CheckpointRequiredException' => ['checkpoint_required'], 18 | 'InstagramAPI\\Exception\\IncorrectPasswordException' => ['The password you entered is incorrect. Please try again.'], 19 | 'InstagramAPI\\Exception\\AccountDisabledException' => ['Your account has been disabled for violating our terms. Learn how you may be able to restore your account.'], 20 | ]; 21 | 22 | foreach ($exceptionsToTest as $exceptionClassName => $testMessages) { 23 | foreach ($testMessages as $testMessage) { 24 | try { 25 | ServerMessageThrower::autoThrow(null, $testMessage); 26 | } catch (\InstagramAPI\Exception\InstagramException $e) { 27 | $thisClassName = get_class($e); 28 | if ($exceptionClassName == $thisClassName) { 29 | echo "{$exceptionClassName}: OK!\n"; 30 | } else { 31 | echo "{$exceptionClassName}: Got {$thisClassName} instead!\n"; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/README.md: -------------------------------------------------------------------------------- 1 | ## Examples 2 | 3 | These examples demonstrate various common tasks and are meant to get you started 4 | with this library. 5 | 6 | Many of these files contain a configuration section at the top, which you must 7 | edit to provide your own account and media details before running the example. 8 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/accessingValues.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 19 | $ig->login(); 20 | } catch (\Exception $e) { 21 | echo 'Something went wrong: '.$e->getMessage()."\n"; 22 | exit(0); 23 | } 24 | 25 | try { 26 | $feed = $ig->getPopularFeed(); 27 | 28 | // The getPopularFeed() has an "items" property, which we need. 29 | $items = $feed->getItems(); 30 | 31 | // Individual item objects have an "id" property. 32 | $firstItem_mediaId = $items[0]->getId(); 33 | 34 | // To get properties with underscores, such as "device_stamp", 35 | // just specify them as camelcase, ie "getDeviceTimestamp" below. 36 | $firstItem_device_timestamp = $items[0]->getDeviceTimestamp(); 37 | 38 | // You can chain multiple function calls in a row to get to the data. 39 | $firstItem_image_versions = $items[0]->getImageVersions2()->getCandidates()[0]->getUrl(); 40 | 41 | echo 'There are '.count($items)." items.\n"; 42 | 43 | echo "First item has media id: {$firstItem_mediaId}.\n"; 44 | echo "First item timestamp is: {$firstItem_device_timestamp}.\n"; 45 | echo "One of the first item image version candidates is: {$firstItem_image_versions}.\n"; 46 | } catch (\Exception $e) { 47 | echo 'Something went wrong: '.$e->getMessage()."\n"; 48 | } 49 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/assets/instagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/assets/instagram.png -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/paginationExample.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 19 | $ig->login(); 20 | } catch (\Exception $e) { 21 | echo 'Something went wrong: '.$e->getMessage()."\n"; 22 | exit(0); 23 | } 24 | 25 | try { 26 | $followers = []; 27 | 28 | // Starting at "null" means starting at the first page. 29 | $maxId = null; 30 | do { 31 | // Request the page corresponding to maxId. 32 | $response = $ig->getSelfUserFollowers($maxId); 33 | 34 | // In this example we're merging the response array, but we can do anything. 35 | $followers = array_merge($followers, $response->getUsers()); 36 | 37 | // Now we must update the maxId variable to the "next page". 38 | // This will be a null value again when we've reached the last page! 39 | // And we will stop looping through pages as soon as maxId becomes null. 40 | $maxId = $response->getNextMaxId(); 41 | } while ($maxId !== null); // Must use "!==" for comparison instead of "!=". 42 | 43 | echo "My followers:\n"; 44 | foreach ($followers as $follower) { 45 | echo '- '.$follower->getUsername().".\n"; 46 | } 47 | } catch (\Exception $e) { 48 | echo 'Something went wrong: '.$e->getMessage()."\n"; 49 | } 50 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/shortcodeConverter.php: -------------------------------------------------------------------------------- 1 | code({$code})\n\n"; 26 | 27 | // From Shortcode to Media ID. 28 | $id = InstagramID::fromCode($code); 29 | echo "Instagram code({$code}) -> id({$id})\n\n"; 30 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/uploadAlbum.php: -------------------------------------------------------------------------------- 1 | 'photo', 23 | 'file' => '', // Path to the photo file. 24 | ], 25 | [ 26 | 'type' => 'photo', 27 | 'file' => '', // Path to the photo file. 28 | /* TAGS COMMENTED OUT UNTIL YOU READ THE BELOW: 29 | 'usertags' => [ // Optional, lets you tag one or more users in a PHOTO. 30 | [ 31 | 'position' => [0.5, 0.5], 32 | 33 | // WARNING: THE USER ID MUST BE VALID. INSTAGRAM WILL VERIFY IT 34 | // AND IF IT'S WRONG THEY WILL SAY "media configure error". 35 | 'user_id' => '123456789', // Must be a numerical UserPK ID. 36 | ], 37 | ], 38 | */ 39 | ], 40 | [ 41 | 'type' => 'video', 42 | 'file' => '', // Path to the video file. 43 | ], 44 | ]; 45 | $captionText = ''; // Caption text to use for the album. 46 | ////////////////////// 47 | 48 | $ig = new \InstagramAPI\Instagram($debug, $truncatedDebug); 49 | 50 | try { 51 | $ig->setUser($username, $password); 52 | $ig->login(); 53 | } catch (\Exception $e) { 54 | echo 'Something went wrong: '.$e->getMessage()."\n"; 55 | exit(0); 56 | } 57 | 58 | try { 59 | $ig->uploadTimelineAlbum($media, ['caption' => $captionText]); 60 | } catch (\Exception $e) { 61 | echo 'Something went wrong: '.$e->getMessage()."\n"; 62 | } 63 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/uploadPhoto.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 24 | $ig->login(); 25 | } catch (\Exception $e) { 26 | echo 'Something went wrong: '.$e->getMessage()."\n"; 27 | exit(0); 28 | } 29 | 30 | try { 31 | $ig->uploadTimelinePhoto($photoFilename, ['caption' => $captionText]); 32 | } catch (\Exception $e) { 33 | echo 'Something went wrong: '.$e->getMessage()."\n"; 34 | } 35 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/examples/uploadVideo.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 24 | $ig->login(); 25 | } catch (\Exception $e) { 26 | echo 'Something went wrong: '.$e->getMessage()."\n"; 27 | exit(0); 28 | } 29 | 30 | try { 31 | // Note that this performs a few automatic chunk upload retries by default, 32 | // in case of failing to upload the video chunks to Instagram's server! 33 | $ig->uploadTimelineVideo($videoFilename, ['caption' => $captionText]); 34 | 35 | // or... 36 | 37 | // Example of using 8 retries instead of the default amount: 38 | // $ig->uploadTimelineVideo($videoFilename, ['caption' => $captionText], 8); 39 | } catch (\Exception $e) { 40 | echo 'Something went wrong: '.$e->getMessage()."\n"; 41 | } 42 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/src/Debug.php: -------------------------------------------------------------------------------- 1 | 1000) { 51 | $response = substr($response, 0, 1000).'...'; 52 | } 53 | echo $res.$response."\n\n"; 54 | } 55 | 56 | public static function printPostData( 57 | $post) 58 | { 59 | if (php_sapi_name() == 'cli') { 60 | $dat = Utils::colouredString('DATA: ', 'yellow'); 61 | } else { 62 | $dat = 'DATA: '; 63 | } 64 | echo $dat.urldecode($post)."\n"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/src/Devices/UserAgent.php: -------------------------------------------------------------------------------- 1 | getManufacturer(); 39 | if ($device->getBrand() !== null) { 40 | $manufacturerWithBrand .= '/'.$device->getBrand(); 41 | } 42 | 43 | // Generate the final User-Agent string. 44 | return sprintf( 45 | self::USER_AGENT_FORMAT, 46 | Constants::VERSION, // App version ("10.8.0"). 47 | $device->getAndroidVersion(), 48 | $device->getAndroidRelease(), 49 | $device->getDPI(), 50 | $device->getResolution(), 51 | $manufacturerWithBrand, 52 | $device->getModel(), 53 | $device->getDevice(), 54 | $device->getCPU(), 55 | Constants::USER_AGENT_LOCALE // Locale ("en_US"). 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/mgp25/instagram-php/src/Exception/AccountDisabledException.php: -------------------------------------------------------------------------------- 1 | street) 12 | . ',' . urlencode($this->city) 13 | . '&format=json&addressdetails=1' 14 | ); 15 | $json = json_decode($data); 16 | return array( 17 | 'lat' => $json[0]->lat, 18 | 'lon' => $json[0]->lon 19 | ); 20 | } 21 | } 22 | ?> 23 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/example/Contact.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/example/run.php: -------------------------------------------------------------------------------- 1 | map($json, new Contact()); 10 | 11 | $coords = $contact->address->getGeoCoords(); 12 | 13 | echo $contact->name . ' lives at coordinates ' 14 | . $coords['lat'] . ',' . $coords['lon'] . "\n"; 15 | ?> -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/example/single.json: -------------------------------------------------------------------------------- 1 | {"name":"Sheldon Cooper","address":{"street":"2311 N. Los Robles Avenue","city":"Pasadena"}} 2 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/src/JsonMapper/Exception.php: -------------------------------------------------------------------------------- 1 | 10 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 11 | * @link http://cweiske.de/ 12 | */ 13 | 14 | /** 15 | * Simple exception 16 | * 17 | * @category Netresearch 18 | * @package JsonMapper 19 | * @author Christian Weiske 20 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 21 | * @link http://cweiske.de/ 22 | */ 23 | class JsonMapper_Exception extends Exception 24 | { 25 | } 26 | ?> 27 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/Array.php: -------------------------------------------------------------------------------- 1 | 10 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 11 | * @link http://cweiske.de/ 12 | */ 13 | 14 | /** 15 | * Unit test helper class for testing property mapping 16 | * 17 | * @category Netresearch 18 | * @package JsonMapper 19 | * @author Christian Weiske 20 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 21 | * @link http://cweiske.de/ 22 | */ 23 | class JsonMapperTest_Array 24 | { 25 | /** 26 | * @var float[] 27 | */ 28 | public $flArray; 29 | 30 | /** 31 | * @var string[] 32 | */ 33 | public $strArray; 34 | 35 | /** 36 | * @var array[string] 37 | */ 38 | public $strArrayV2; 39 | 40 | /** 41 | * @var JsonMapperTest_Simple[] 42 | * @see http://phpdoc.org/docs/latest/references/phpdoc/types.html#arrays 43 | */ 44 | public $typedArray; 45 | 46 | /** 47 | * @var DateTime[] 48 | */ 49 | public $typedSimpleArray; 50 | 51 | /** 52 | * @var string[]|null 53 | */ 54 | public $nullableSimpleArray; 55 | 56 | /** 57 | * This generates an array object with original json values 58 | * @var ArrayObject 59 | */ 60 | public $pArrayObject; 61 | 62 | /** 63 | * This generates an array object with original json values, 64 | * and may be NULL 65 | * @var ArrayObject|null 66 | */ 67 | public $pNullableArrayObject; 68 | 69 | /** 70 | * This generates an array object with JsonMapperTest_Simple instances 71 | * @var ArrayObject[JsonMapperTest_Simple] 72 | */ 73 | public $pTypedArrayObject; 74 | 75 | /** 76 | * @var ArrayObject[int] 77 | */ 78 | public $pSimpleArrayObject; 79 | 80 | } 81 | ?> 82 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/Broken.php: -------------------------------------------------------------------------------- 1 | 10 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 11 | * @link http://cweiske.de/ 12 | */ 13 | 14 | /** 15 | * Unit test helper class for testing property mapping 16 | * 17 | * @category Netresearch 18 | * @package JsonMapper 19 | * @author Christian Weiske 20 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 21 | * @link http://cweiske.de/ 22 | */ 23 | class JsonMapperTest_Broken 24 | { 25 | /** 26 | * @var ArrayObject[ThisClassDoesNotExist] 27 | */ 28 | public $pTypedArrayObjectNoClass; 29 | 30 | /** 31 | * 32 | * @var string 33 | * @required 34 | */ 35 | public $pMissingData; 36 | } 37 | ?> 38 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/DependencyInjector.php: -------------------------------------------------------------------------------- 1 | db = 'database'; 23 | 24 | return $object; 25 | } 26 | } 27 | ?> -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/Logger.php: -------------------------------------------------------------------------------- 1 | 10 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 11 | * @link http://cweiske.de/ 12 | */ 13 | 14 | /** 15 | * Simple in-memory logger 16 | * 17 | * @category Netresearch 18 | * @package JsonMapper 19 | * @author Christian Weiske 20 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 21 | * @link http://cweiske.de/ 22 | */ 23 | class JsonMapperTest_Logger 24 | { 25 | public $log = array(); 26 | 27 | /** 28 | * Log a message to the $logger object 29 | * 30 | * @param string $level Logging level 31 | * @param string $message Text to log 32 | * @param array $context Additional information 33 | * 34 | * @return null 35 | */ 36 | public function log($level, $message, array $context = array()) 37 | { 38 | $this->log[] = array($level, $message, $context); 39 | } 40 | } 41 | ?> -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/Object.php: -------------------------------------------------------------------------------- 1 | nullableObject = $obj; 28 | } 29 | 30 | /** 31 | * @param JsonMapperTest_PlainObject|null $obj 32 | */ 33 | public function setDocblockNullableObject($obj) 34 | { 35 | $this->docblockNullableObject = $obj; 36 | } 37 | } 38 | ?> 39 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/PHP7_Object.php: -------------------------------------------------------------------------------- 1 | typeNullableObject = $obj; 8 | } 9 | 10 | /** 11 | * @param JsonMapperTest_PlainObject $obj 12 | */ 13 | public function setNonNullableObject($obj) 14 | { 15 | $this->nonNullableObject = $obj; 16 | } 17 | } 18 | ?> 19 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/PlainObject.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/PrivateWithSetter.php: -------------------------------------------------------------------------------- 1 | privateProperty = $privateProperty; 30 | return $this; 31 | } 32 | 33 | /** 34 | * @param int $ppps 35 | * 36 | * @return $this 37 | */ 38 | private function setPrivatePropertyPrivateSetter($ppps) 39 | { 40 | $this->privatePropertyPrivateSetter = $ppps; 41 | return $this; 42 | } 43 | 44 | /** 45 | * There is no property with this name, only a setter method 46 | * 47 | * @param int $ps 48 | * 49 | * @return $this 50 | */ 51 | private function setPrivateSetter($ps) 52 | { 53 | $this->_internal['ps'] = $ps; 54 | return $this; 55 | } 56 | 57 | /** 58 | * @return int 59 | */ 60 | public function getPrivateProperty() 61 | { 62 | return $this->privateProperty; 63 | } 64 | 65 | /** 66 | * @return int 67 | */ 68 | public function getPrivateNoSetter() 69 | { 70 | return $this->privateNoSetter; 71 | } 72 | 73 | /** 74 | * @return int 75 | */ 76 | public function getPrivatePropertyPrivateSetter() 77 | { 78 | return $this->privatePropertyPrivateSetter; 79 | } 80 | 81 | public function getPrivateSetter() 82 | { 83 | return $this->_internal['ps']; 84 | } 85 | } 86 | ?> 87 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/JsonMapperTest/ValueObject.php: -------------------------------------------------------------------------------- 1 | value = $value; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/PHP7_ObjectTest.php: -------------------------------------------------------------------------------- 1 | 10 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 11 | * @link https://github.com/cweiske/jsonmapper 12 | */ 13 | 14 | /** 15 | * Unit tests for JsonMapper's object handling using PHP 7.1 syntax 16 | * 17 | * @category Tools 18 | * @package JsonMapper 19 | * @author Christian Weiske 20 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 21 | * @link https://github.com/cweiske/jsonmapper 22 | * @requires PHP 7.1 23 | */ 24 | class PHP7_1_ObjectTest extends \PHPUnit_Framework_TestCase 25 | { 26 | /** 27 | * Sets up test cases loading required classes. 28 | * 29 | * This is in setUp and not at the top of this file to ensure this is only 30 | * executed with PHP 7.1 (due to the `@requires` tag). 31 | */ 32 | protected function setUp() 33 | { 34 | require_once 'JsonMapperTest/PlainObject.php'; 35 | require_once 'JsonMapperTest/PHP7_Object.php'; 36 | } 37 | /** 38 | * Test for PHP7 nullable types like "?Object" 39 | */ 40 | public function testObjectSetterTypeNullable() 41 | { 42 | $jm = new JsonMapper(); 43 | $sn = $jm->map( 44 | json_decode('{"typeNullableObject":null}'), 45 | new JsonMapperTest_PHP7_Object() 46 | ); 47 | $this->assertNull($sn->typeNullableObject); 48 | } 49 | 50 | /** 51 | * Test for non-nullable types like "@param object" with null value 52 | * 53 | * @expectedException JsonMapper_Exception 54 | * @expectedExceptionMessage JSON property "nonNullableObject" in class "JsonMapperTest_PHP7_Object" must not be NULL 55 | */ 56 | public function testObjectSetterDocblockInvalidNull() 57 | { 58 | $jm = new JsonMapper(); 59 | $sn = $jm->map( 60 | json_decode('{"nonNullableObject":null}'), 61 | new JsonMapperTest_PHP7_Object() 62 | ); 63 | } 64 | } 65 | ?> 66 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/namespacetest/Unit.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/namespacetest/UnitData.php: -------------------------------------------------------------------------------- 1 | internalData['namespacedTypeHint'] = $foo; 47 | } 48 | } 49 | ?> 50 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/namespacetest/model/MyArrayObject.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/namespacetest/model/User.php: -------------------------------------------------------------------------------- 1 | name = $name; 12 | } 13 | } 14 | 15 | ?> 16 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/namespacetest/model/UserList.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/othernamespace/Foo.php: -------------------------------------------------------------------------------- 1 | name = $name; 11 | } 12 | } 13 | ?> 14 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/netresearch/jsonmapper/tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | ../src/ 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/psr/http-message/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file, in reverse chronological order by release. 4 | 5 | ## 1.0.1 - 2016-08-06 6 | 7 | ### Added 8 | 9 | - Nothing. 10 | 11 | ### Deprecated 12 | 13 | - Nothing. 14 | 15 | ### Removed 16 | 17 | - Nothing. 18 | 19 | ### Fixed 20 | 21 | - Updated all `@return self` annotation references in interfaces to use 22 | `@return static`, which more closelly follows the semantics of the 23 | specification. 24 | - Updated the `MessageInterface::getHeaders()` return annotation to use the 25 | value `string[][]`, indicating the format is a nested array of strings. 26 | - Updated the `@link` annotation for `RequestInterface::withRequestTarget()` 27 | to point to the correct section of RFC 7230. 28 | - Updated the `ServerRequestInterface::withUploadedFiles()` parameter annotation 29 | to add the parameter name (`$uploadedFiles`). 30 | - Updated a `@throws` annotation for the `UploadedFileInterface::moveTo()` 31 | method to correctly reference the method parameter (it was referencing an 32 | incorrect parameter name previously). 33 | 34 | ## 1.0.0 - 2016-05-18 35 | 36 | Initial stable release; reflects accepted PSR-7 specification. 37 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/psr/http-message/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 PHP Framework Interoperability Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/psr/http-message/README.md: -------------------------------------------------------------------------------- 1 | PSR Http Message 2 | ================ 3 | 4 | This repository holds all interfaces/classes/traits related to 5 | [PSR-7](http://www.php-fig.org/psr/psr-7/). 6 | 7 | Note that this is not a HTTP message implementation of its own. It is merely an 8 | interface that describes a HTTP message. See the specification for more details. 9 | 10 | Usage 11 | ----- 12 | 13 | We'll certainly need some stuff in here. -------------------------------------------------------------------------------- /app/Services/Content/phpapi/vendor/psr/http-message/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "psr/http-message", 3 | "description": "Common interface for HTTP messages", 4 | "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], 5 | "homepage": "https://github.com/php-fig/http-message", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "PHP-FIG", 10 | "homepage": "http://www.php-fig.org/" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.3.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Psr\\Http\\Message\\": "src/" 19 | } 20 | }, 21 | "extra": { 22 | "branch-alias": { 23 | "dev-master": "1.0.x-dev" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Services/Content/savedStatus/comments.json: -------------------------------------------------------------------------------- 1 | "{\"topic\": \"food\", \"maxpp\": \"3\", \"num\": \"9\", \"comments\": \"Something went wrong: Network: cURL error 56: SSLRead() return error -9806 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html).\\n\"}" 2 | 3 | 4 | 5 | {"topic": "food", "num": "9", "comments": "{"topic": "food", "num": "9", "comments": "[\"@hansgardiner planning\",\"@ale.christina me rn lmao\",\"Delicious!\",\"👍🏾👍🏾👍🏾👍🏾👍🏾\",\"✌🏼✌🏼✌🏼✌🏼\",\"Wow\",\"Σάββατο σήμερα οπότε είχαμε χρόνο για παστίτσιοοοοο @desp1navandi !Kαλή όρεξη!💕\",\"Ψαρόσουπα κοκκινιστη 🍲🐟🍅\",\"Θέλω κ γω 😋\"]\r\n", "maxpp": "3"}", "maxpp": "3"} 6 | {"topic": "food", "num": "9", "comments": "{"topic": "food", "num": "9", "comments": "[\"@hansgardiner planning\",\"@ale.christina me rn lmao\",\"Delicious!\",\"👍🏾👍🏾👍🏾👍🏾👍🏾\",\"✌🏼✌🏼✌🏼✌🏼\",\"Wow\",\"Σάββατο σήμερα οπότε είχαμε χρόνο για παστίτσιοοοοο @desp1navandi !Kαλή όρεξη!💕\",\"Ψαρόσουπα κοκκινιστη 🍲🐟🍅\",\"Θέλω κ γω 😋\"]\r\n", "maxpp": "3"}", "maxpp": "3"} 7 | 8 | {"topic": "food", "num": "9", "comments": "{"topic": "food", "num": "9", "comments": "[\"@hansgardiner planning\",\"@ale.christina me rn lmao\",\"Delicious!\",\"👍🏾👍🏾👍🏾👍🏾👍🏾\",\"✌🏼✌🏼✌🏼✌🏼\",\"Wow\",\"Σάββατο σήμερα οπότε είχαμε χρόνο για παστίτσιοοοοο @desp1navandi !Kαλή όρεξη!💕\",\"Ψαρόσουπα κοκκινιστη 🍲🐟🍅\",\"Θέλω κ γω 😋\"]\r\n", "maxpp": "3"}", "maxpp": "3"} -------------------------------------------------------------------------------- /app/Services/Content/savedStatus/userinformation.json: -------------------------------------------------------------------------------- 1 | {"timestamp":1500121461,"username":"tr3ndfood","follower_count":61,"following_count":158,"media_count":16,"usertags_count":0,"feed_items":16,"likes":648,"comments":15} -------------------------------------------------------------------------------- /app/Services/Scheduling/HumanScheduler.py: -------------------------------------------------------------------------------- 1 | ### Starting to work for some time ... and do cerntain task in this time 2 | 3 | # We have a big steam of time , for example 8 hours 4 | 5 | # Now we need to pass in this steam small micro task and random delays 6 | 7 | # Total Steam Time = Time for all task + Time of all delays 8 | 9 | # The problem is, that some task take longer and some task are done really quick, we have to consider this 10 | 11 | import datetime 12 | import json 13 | import logging 14 | import random 15 | # imports 16 | import time 17 | 18 | # read config 19 | with open('./../config.json') as data_file: 20 | config = json.load(data_file) 21 | 22 | 23 | 24 | 25 | def mainloop(arrayOfTasks, endTime=float("inf")): 26 | for i, task in enumerate(arrayOfTasks): 27 | arrayOfTasks[i] = task() 28 | 29 | while endTime > time.time(): 30 | fuc = random.choice(arrayOfTasks) 31 | fuc.run() 32 | timeToSleep = random.randint(60, 300) 33 | logging.warn('Sleeping for ' + str(timeToSleep)) 34 | print('Sleeping for ' + str(timeToSleep)) 35 | time.sleep(timeToSleep) 36 | -------------------------------------------------------------------------------- /app/Services/Scheduling/SleepJob.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import json 3 | import logging 4 | import random 5 | import time 6 | 7 | 8 | def start(dayScheduler, tasks): 9 | # config logging 10 | logging.basicConfig(filename='sleepJob.log', level=logging.DEBUG) 11 | 12 | # load configuration 13 | with open('./../config.json') as data_file: 14 | config = json.load(data_file) 15 | 16 | ##########Define functions ############### 17 | 18 | # humanize function 19 | def humanize(number, margin): 20 | return number + random.uniform(-1 * margin, margin) 21 | 22 | def getTimestamp(timeInFloat): 23 | fhours = timeInFloat 24 | ihours = int(timeInFloat) 25 | # get current time 26 | lst = list(datetime.datetime.now().timetuple()) 27 | # if the hours are lower then curr hour, then it is the next day 28 | if (lst[3] + (2 * config['marginTime']) > ihours): 29 | lst[2] = lst[2] + 1 30 | # overrite time with new hours, mins, secs 31 | lst[3] = ihours 32 | lst[4] = int((fhours - ihours) * 60) 33 | lst[5] = int(((fhours - ihours) * 3600) % 60) 34 | return time.mktime(time.struct_time(tuple(lst))) 35 | 36 | ############## Main Loop ################## 37 | while (True): 38 | # 1. generate new sleep and wakeup time 39 | wakeUpTime = getTimestamp(humanize(config['wakeUpHour'], config['marginTime'])) 40 | sleepTime = getTimestamp(humanize(config['sleepHour'], config['marginTime'])) 41 | print ('Going to bed at: ' + str(datetime.datetime.fromtimestamp(sleepTime))) 42 | print ('Waking up at: ' + str(datetime.datetime.fromtimestamp(wakeUpTime))) 43 | # 2. Work until sleep 44 | while (sleepTime > time.time()): 45 | print('Calling Human Scheduler') 46 | time.sleep(5) 47 | # try: 48 | dayScheduler(tasks, sleepTime) 49 | # except Exception as e: 50 | # logging.error(e.message, e.args) 51 | print('Return from Human Scheduler') 52 | 53 | time.sleep(5) 54 | # 3. Sleep Until Wakeup 55 | while (wakeUpTime > time.time()): 56 | time.sleep(5) 57 | # 4. Start again 58 | print ('Starting a new Cycle...') 59 | -------------------------------------------------------------------------------- /app/Services/Scheduling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/Services/Scheduling/__init__.py -------------------------------------------------------------------------------- /app/Services/StatusReport.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import time 3 | import json 4 | 5 | def statusServer(): 6 | 7 | with open('./../config.json') as data_file: 8 | config = json.load(data_file) 9 | 10 | while(True): 11 | try: 12 | payload = {'username': config['username'], 'topic': config['topic']} 13 | requests.post("http://" + config['dashboardIp']+":"+config['dashboardPort'], json=payload) 14 | time.sleep(10) 15 | except Exception: 16 | pass 17 | 18 | -------------------------------------------------------------------------------- /app/Services/Tasks/InstaPySession.py: -------------------------------------------------------------------------------- 1 | import json 2 | import random 3 | import time 4 | import logging 5 | from .InstaPy.instapy import InstaPy 6 | from .Task import baseTask 7 | 8 | 9 | # Write your automation here 10 | # Stuck ? Look at the github page or the examples in the examples folder 11 | 12 | 13 | class InstaPyTask(baseTask): 14 | def run(self): 15 | numberOfImagesToLike = random.randint(30, 200) 16 | logging.info('T: Like ' + str(numberOfImagesToLike) + ' images') 17 | print('T: Like ' + str(numberOfImagesToLike) + ' images') 18 | unfollowCount = random.randint(3, 10) 19 | instaPySession(self.config['username'], self.config['password'], numberOfImagesToLike, unfollowCount) 20 | 21 | 22 | def getRndTag(): 23 | with open('./savedStatus/hashtags.json') as data_file: 24 | hashtagarray = json.load(data_file) 25 | return random.choice(hashtagarray) 26 | 27 | 28 | def instaPySession(username, password, amoutOfLikes, unfollowCount): 29 | # If you want to enter your Instagram Credentials directly just enter 30 | # username= and password= into InstaPy 31 | # e.g like so InstaPy(username="instagram", password="test1234") 32 | starttime = time.time() 33 | InstaPy(username=username, password=password, nogui=False) \ 34 | .login() \ 35 | .set_do_follow(enabled=True, percentage=33, times=2) \ 36 | .set_upper_follower_count(limit=400) \ 37 | .like_by_tags([getRndTag()], amount=amoutOfLikes) \ 38 | .end() 39 | print ('Done in ' + str(time.time() - starttime) + ' sec') 40 | -------------------------------------------------------------------------------- /app/Services/Tasks/Sleep.py: -------------------------------------------------------------------------------- 1 | from Task import baseTask 2 | import random 3 | import time 4 | import datetime 5 | 6 | class SleepTask(baseTask): 7 | def run(self): 8 | timeToSleep = (random.uniform(12.0, 22.0)) * 60 9 | print(str(datetime.datetime.now()) + ' - Sleeping for ' + str(timeToSleep)) 10 | time.sleep(timeToSleep) -------------------------------------------------------------------------------- /app/Services/Tasks/Task.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | class baseTask(): 4 | maxCountPerDay = 0 5 | currRunCounter = 0 6 | 7 | def __init__(self): 8 | with open('./../config.json') as data_file: 9 | self.config = json.load(data_file) 10 | 11 | def run(self): 12 | if self.currRunCounter > self.maxCountPerDay: 13 | return "{} has run enough today".format(self.__class__.__name__) 14 | self.currRunCounter += 1 15 | print('Task runned') 16 | -------------------------------------------------------------------------------- /app/Services/Tasks/UploadImage.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import subprocess 3 | from .Task import baseTask 4 | 5 | 6 | class uploadTask(baseTask): 7 | def run(self): 8 | logging.info('T: Uploading a Photo') 9 | print('T: Uploading a Photo') 10 | subprocess.check_output(["php", "phpapi/uploadImage.php", self.config['username'], self.config['password']]) 11 | 12 | -------------------------------------------------------------------------------- /app/Services/Tasks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/Services/Tasks/__init__.py -------------------------------------------------------------------------------- /app/Services/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/Services/__init__.py -------------------------------------------------------------------------------- /app/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/__init__.py -------------------------------------------------------------------------------- /app/assets/unicodes.md: -------------------------------------------------------------------------------- 1 | Unicode 2 | 3 | - ✅ \u2705 4 | - ✊ \u270A 5 | - ✋ \u270B 6 | - ✌ \u270C 7 | - ✔ \u2714 8 | - ✨ \u2728 9 | - ❗ \u2757 10 | - ‼ \u203C 11 | - ❤ \u2764 12 | - ➰ \u27B0 13 | - ➡ \u27A1 14 | - ⌚ \u231A 15 | - ☀ \u2600 16 | - ☑ \u2611 17 | - ☺ \u263A 18 | - ♥ \u2665 19 | - ⭐ \u2B50 20 | - ☹ \u2639 21 | - ❣\u2763 22 | - ☕ \u2615 23 | - ⛰ \u26F0 24 | - ⛪ \u26EA 25 | - ⚓ \u2693 26 | - ⛴ \u26F4 27 | - ✈ \u2708 28 | - ☁ \u2601 29 | - ⛅ \u26C5 30 | - ⛈ \u26C8 31 | - ☂ \u2602 32 | - ⚡ \u26A1 33 | - ❄ \u2744 34 | - ☃ \u2603 35 | - ☄ \u2604 36 | - ⚽ \u26BD 37 | - ⛸ \u26F8 38 | - ⌨ \u2328 39 | - ☯ \u262F -------------------------------------------------------------------------------- /app/logs/followRestriction.json: -------------------------------------------------------------------------------- 1 | {"girlsandcars777": 1, "fastlanewestbound": 1, "downtown_musician": 1, "jmmotorsport.chelm": 1} -------------------------------------------------------------------------------- /app/logs/followed.txt: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /app/logs/followerNum.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 2017-06-06 13:57 49 3 | 2017-06-06 14:01 49 4 | 2017-06-06 14:27 49 5 | 2017-06-06 14:45 49 6 | 2017-06-06 14:50 49 7 | 2017-06-06 14:56 49 8 | 2017-06-06 15:11 50 9 | 2017-06-06 15:13 50 10 | 2017-06-06 17:01 52 11 | 2017-06-06 17:06 52 12 | 2017-06-06 17:17 52 13 | 2017-06-06 17:18 52 14 | 2017-06-06 17:30 54 15 | 2017-06-06 17:33 54 16 | 2017-06-06 17:37 54 17 | 2017-06-06 17:38 54 18 | 2017-06-06 17:51 54 19 | 2017-06-06 18:17 56 20 | 2017-06-06 19:59 56 21 | 2017-06-17 14:20 57 22 | 2017-06-21 16:19 55 23 | 2017-06-26 14:16 54 24 | 2017-06-26 14:16 54 25 | -------------------------------------------------------------------------------- /app/logs/run.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/logs/run.txt -------------------------------------------------------------------------------- /app/main.py: -------------------------------------------------------------------------------- 1 | from Services.Content import Images 2 | from Services.Content import Hashtags 3 | from Services.Scheduling import SleepJob 4 | from Services.Scheduling import HumanScheduler 5 | from Services.Tasks import Task 6 | from Services.Tasks import UploadImage 7 | from Services.Tasks import InstaPySession 8 | from Services import StatusReport 9 | import os.path 10 | import threading 11 | import json 12 | 13 | # load config 14 | with open('./../config.json') as data_file: 15 | config = json.load(data_file) 16 | 17 | 18 | 19 | class Instabot(): 20 | sleeping = True 21 | Tasks = [Task.baseTask] 22 | 23 | def __init__(self): 24 | if not os.path.isfile('savedStatus/hashtags.json'): 25 | print('Generate Hashtags') 26 | Hashtags.generate(config['topic'], config['amountOfHashtags']) 27 | 28 | if not os.path.isfile('savedStatus/images.json'): 29 | print('Generate Images') 30 | Images.generate(config['topic']) 31 | 32 | def start(self): 33 | if self.sleeping: 34 | SleepJob.start(HumanScheduler.mainloop, self.Tasks) 35 | else: 36 | HumanScheduler.mainloop(self.Tasks) 37 | 38 | def runStatusServer(self): 39 | thread = threading.Thread(target=StatusReport.statusServer) 40 | thread.daemon = True # Daemonize thread so it gets destroyed with main thread together 41 | thread.start() 42 | 43 | 44 | if __name__ == '__main__': 45 | Bot = Instabot() 46 | Bot.runStatusServer() 47 | Bot.Tasks = [InstaPySession.InstaPyTask, InstaPySession.InstaPyTask, UploadImage.uploadTask] 48 | Bot.start() 49 | 50 | 51 | def startMain(): 52 | Bot = Instabot() 53 | Bot.Tasks = [InstaPySession.InstaPyTask, InstaPySession.InstaPyTask, UploadImage.uploadTask] 54 | Bot.start() 55 | 56 | 57 | def startThread(): 58 | Mainthread = threading.Thread(target=startMain) 59 | Mainthread.daemon = True 60 | Mainthread.start() 61 | return Mainthread 62 | -------------------------------------------------------------------------------- /app/phpapi/comments.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 23 | $ig->login(); 24 | } catch (\Exception $e) { 25 | echo 'Something went wrong: '.$e->getMessage()."\n"; 26 | exit(0); 27 | } 28 | 29 | try { 30 | 31 | /*if ( 0 == filesize( $file_path ) ) 32 | { 33 | // file is empty 34 | 35 | $count = 1; 36 | foreach ($fields as $value) 37 | { 38 | echo $value; 39 | 40 | if (count($fields) != $count) echo ","; 41 | else echo "\r\n"; 42 | 43 | $count = $count + 1; 44 | } 45 | }*/ 46 | 47 | $tagsResult = $ig->getHashtagFeed($topic); 48 | $tags = $tagsResult->ranked_items; 49 | 50 | // array_values($tags)[0]; 51 | 52 | // echo "Results: " . $tagsResult->num_results . ",\r\n"; 53 | // echo $topic . ",\r\n"; 54 | // echo array_values($tags)[0]->name; 55 | 56 | $results = array(); 57 | 58 | foreach ($tags as $value) 59 | { 60 | $commentsResp = $ig->getMediaComments($value->id); 61 | $comments = $commentsResp->comments; 62 | if ($commentsResp->comment_count > 0) { 63 | 64 | $imgCommentCounter = 0; 65 | foreach ($comments as $comment) 66 | { 67 | if (count($results) < $num) { 68 | if ($imgCommentCounter < $maxpp) { 69 | $commentText = $comment->text; 70 | $results[] = $commentText; 71 | $imgCommentCounter = $imgCommentCounter + 1; 72 | } else { 73 | break; 74 | } 75 | } else { 76 | echo json_encode($results,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); 77 | echo "\r\n"; 78 | return; 79 | } 80 | } 81 | } 82 | } 83 | 84 | echo json_encode($results,JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); 85 | echo "\r\n"; 86 | } catch (\Exception $e) { 87 | echo 'Something went wrong: '.$e->getMessage()."\n"; 88 | } -------------------------------------------------------------------------------- /app/phpapi/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "mgp25/instagram-php": "^2.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /app/phpapi/relatedTags.php: -------------------------------------------------------------------------------- 1 | 2 | setUser($username, $password); 19 | $ig->login(); 20 | } catch (\Exception $e) { 21 | echo 'Something went wrong: '.$e->getMessage()."\n"; 22 | exit(0); 23 | } 24 | try { 25 | 26 | $tag = $argv[1]; 27 | //\InstagramAPI\Response\SearchTagResponse 28 | $related = $ig->getTagRelated($tag); 29 | $newHashtagsArray = array(); 30 | foreach ($related->related as $hashtag) { 31 | if ($hashtag->type == "hashtag"){ 32 | array_push($newHashtagsArray, $hashtag->name); 33 | } 34 | } 35 | echo implode(" ",$newHashtagsArray); 36 | } catch (\Exception $e) { 37 | echo 'Something went wrong: '.$e->getMessage()."\n"; 38 | } 39 | -------------------------------------------------------------------------------- /app/phpapi/statistics.php: -------------------------------------------------------------------------------- 1 | setUser($username, $password); 22 | $ig->login(); 23 | } catch (\Exception $e) { 24 | echo 'Something went wrong: '.$e->getMessage()."\n"; 25 | exit(0); 26 | } 27 | 28 | try { 29 | 30 | $obj = array(); 31 | 32 | $user = $ig->getUserInfoByName($targetname); 33 | $userid = $user->user->pk; 34 | $feed = $ig->getUserFeed($userid); 35 | $feed_items = $feed->items; 36 | 37 | $likes = 0; 38 | $comments = 0; 39 | 40 | $obj["timestamp"] = time(); 41 | $obj["username"] = $user->user->username; 42 | $obj["follower_count"] = $user->user->follower_count; 43 | $obj["following_count"] = $user->user->following_count; 44 | $obj["media_count"] = $user->user->media_count; 45 | $obj["usertags_count"] = $user->user->usertags_count; 46 | $obj["feed_items"] = count($feed->items); 47 | 48 | do 49 | { 50 | foreach ($feed_items as $value) 51 | { 52 | $likes = $likes + $value->like_count; 53 | $comments = $comments + $value->comment_count; 54 | } 55 | 56 | if ($feed->more_available) 57 | { 58 | $feed = $ig->getUserFeed($userid, $feed->next_max_id); 59 | $feed_items = $feed->items; 60 | } 61 | } while ($feed->more_available); 62 | 63 | $obj["likes"] = $likes; 64 | $obj["comments"] = $comments; 65 | 66 | echo json_encode($obj); 67 | } catch (\Exception $e) { 68 | echo 'Something went wrong: '.$e->getMessage()."\n"; 69 | } 70 | -------------------------------------------------------------------------------- /app/remoteExec.py: -------------------------------------------------------------------------------- 1 | from socketIO_client import SocketIO 2 | import time 3 | import Services.Content.Comments as Comments 4 | import Services.Content.Statistics as Statistics 5 | import Services.Content.Hashtags as Hashtags 6 | import Services.Content.Images as Images 7 | 8 | import main 9 | 10 | 11 | 12 | def on_get_comments(*args): 13 | print('get comments') 14 | try: 15 | args[3](None, Comments.getComments(args[0], args[1], args[2])) 16 | except Exception as e: 17 | print(str(e)) 18 | args[3](str(e), None) 19 | 20 | 21 | def on_get_statistics(*args): 22 | print('get statistics') 23 | try: 24 | args[1](None, Statistics.getUserInformation(args[0])) 25 | except Exception as e: 26 | print(str(e)) 27 | args[1](str(e), None) 28 | 29 | def on_get_hashtags(*args): 30 | print('get hashtags') 31 | try: 32 | args[2](None, Hashtags.generate(args[0], args[1])) 33 | except Exception as e: 34 | print(str(e)) 35 | args[2](str(e), None) 36 | 37 | def on_get_images(*args): 38 | print('get images') 39 | try: 40 | args[1](None, Images.generate_onepage(args[0])) 41 | except Exception as e: 42 | print(str(e)) 43 | args[1](str(e), None) 44 | 45 | def on_start_bot(*args): 46 | print('starting bot') 47 | try: 48 | thread = main.startThread() 49 | args[0](None, 'bot started') 50 | except Exception as e: 51 | print(str(e)) 52 | args[0](str(e), None) 53 | 54 | def on_stop_bot(): 55 | print('stopping bot') 56 | 57 | 58 | def on_connect(): 59 | print('connect') 60 | socketIO.emit('registerRemoteJob') 61 | 62 | def on_disconnect(): 63 | print('disconnect') 64 | 65 | def on_reconnect(): 66 | print('reconnect') 67 | time.sleep(0.2) 68 | socketIO.emit('registerRemoteJob') 69 | 70 | 71 | def on_aaa_response(*args): 72 | print('on_aaa_response', args) 73 | 74 | socketIO = SocketIO('localhost', 3000) 75 | socketIO.on('connect', on_connect) 76 | socketIO.on('on_aaa_response', on_aaa_response) 77 | socketIO.on('reconnect', on_reconnect) 78 | socketIO.on('disconnect', on_disconnect) 79 | socketIO.on('getComments', on_get_comments) 80 | socketIO.on('getStatistics', on_get_statistics) 81 | socketIO.on('getHashtags', on_get_hashtags) 82 | socketIO.on('getImages', on_get_images) 83 | socketIO.on('startBot', on_start_bot) 84 | socketIO.on('stopBot', on_stop_bot) 85 | 86 | socketIO.wait() -------------------------------------------------------------------------------- /app/savedStatus/comments.json: -------------------------------------------------------------------------------- 1 | {"num": 3, "comments": "[\"100%!!! GAY\",\"Exhausts\ud83d\ude02\",\"With rainbow farting\"]\r\n", "topic": "car", "maxpp": 3} -------------------------------------------------------------------------------- /app/savedStatus/filetokeepfolderalive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/app/savedStatus/filetokeepfolderalive -------------------------------------------------------------------------------- /app/static/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; } 5 | 6 | body { 7 | background: black; 8 | font: 13px Helvetica, Arial; } 9 | body .servers { 10 | background-color: gray; 11 | width: 30%; 12 | height: 100%; 13 | float: left; } 14 | body .servers .server { 15 | padding-top: 20px; } 16 | body .servers .running { 17 | background-color: lightgreen; } 18 | body .servers .stopped { 19 | background-color: lightcoral; } 20 | body .logs { 21 | float: left; 22 | background: black; 23 | width: 70%; 24 | height: 100%; 25 | color: white; } 26 | 27 | /*# sourceMappingURL=app.css.map */ 28 | -------------------------------------------------------------------------------- /app/static/app.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,CAAE;EACA,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,UAAU;;AAGxB,IAAK;EACH,UAAU,EAAE,KAAK;EACjB,IAAI,EAAE,qBAAqB;EAC3B,aAAQ;IACN,gBAAgB,EAAE,IAAI;IACtB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,qBAAO;MACL,WAAW,EAAE,IAAI;IAEnB,sBAAQ;MACN,gBAAgB,EAAE,UAAU;IAE9B,sBAAQ;MACN,gBAAgB,EAAE,UAAU;EAGhC,UAAK;IACH,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,KAAK;IACjB,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,KAAK", 4 | "sources": ["app.scss"], 5 | "names": [], 6 | "file": "app.css" 7 | } -------------------------------------------------------------------------------- /app/static/app.js: -------------------------------------------------------------------------------- 1 | var socket = io(); 2 | 3 | var vm = new Vue({ 4 | el: "#dashboard", 5 | data: { 6 | selected: '', 7 | servers: [ 8 | { 9 | 'lastUpdate': 22222222222220, 10 | 'name': 'Example', 11 | 'ip': '129.123.3.123', 12 | 'running': true, 13 | 'info': { 14 | 'Follower': 200, 15 | 'Images': 80 16 | } 17 | } 18 | ], 19 | logs: { 20 | '129.123.3.123': ['bla bla bal', 'bla bal bla '], 21 | '129.123.3.122': ['bla bla basdfal', 'asdf asdf bla ', 'bla blasdfa bal', 'bla baasdfasdfl bla '] 22 | } 23 | } 24 | }); 25 | 26 | socket.on('update', function (data) { 27 | data.lastUpdate = Date.now(); 28 | vm.servers.push(data); 29 | }); 30 | 31 | setInterval(function () { 32 | // check if servers are running 33 | 34 | var username = 'motasar2day'; 35 | socket.emit('getStatistics', username, function (error, message) { 36 | console.log("e: "+error); 37 | console.log("m: "+message); 38 | }); 39 | 40 | var topic = 'cat'; 41 | var maxpp = 3; 42 | var maxtotal = 6; 43 | socket.emit('getComments', topic, maxpp, maxtotal, function (error, message) { 44 | console.log("e: "+error); 45 | console.log("m: "+message); 46 | }); 47 | }, 3000); 48 | 49 | timemargine_in_milsec = 6000; 50 | 51 | setInterval(function () { 52 | // check if servers are running 53 | for (var i = 0; i < vm.servers.length; i++) { 54 | var server = vm.servers[i]; 55 | var timediff = (Date.now() - server.lastUpdate); 56 | vm.servers[i].running = timediff < timemargine_in_milsec; 57 | } 58 | }, 10000); 59 | -------------------------------------------------------------------------------- /app/static/app.scss: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background: black; 9 | font: 13px Helvetica, Arial; 10 | .servers{ 11 | background-color: gray; 12 | width: 30%; 13 | height: 100%; 14 | float: left; 15 | .server{ 16 | padding-top: 20px; 17 | } 18 | .running{ 19 | background-color: lightgreen; 20 | } 21 | .stopped{ 22 | background-color: lightcoral; 23 | } 24 | } 25 | .logs{ 26 | float: left; 27 | background: black; 28 | width: 70%; 29 | height: 100%; 30 | color: white; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /app/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dashbaord 5 | 6 | 7 | 8 | 9 | 10 | 11 | {{server.name}} 12 | IP: {{server.ip}} 13 | {{key}}: {{value}} 14 | 15 | 16 | 17 | 18 | {{value}} 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | -------------------------------------------------------------------------------- /app/test.py: -------------------------------------------------------------------------------- 1 | import Services.Content.Comments as Comments 2 | import unicodedata 3 | 4 | teststring = Comments.getComments('car', 2, 6) 5 | # teststring = unicode(Comments.getComments('car', 2, 6), 'utf-8') 6 | # teststring = str(Comments.getComments('car', 2, 6), 'utf-8') 7 | 8 | #encode it with string escape 9 | 10 | print (teststring) -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "username": "someinstagramaccount", 3 | "password": "somepassword", 4 | "amountOfHashtags": 10, 5 | "topic": "computer", 6 | "wakeUpHour": 8, 7 | "sleepHour": 22, 8 | "marginTime": 1.5, 9 | "maxImagesPerDay": 18, 10 | "minImagesPerDay": 4, 11 | "maxLikePerDay": 900, 12 | "minLikePerDay": 100, 13 | "percentageToFollow": 6.66, 14 | "lowerFollowerCount": 2, 15 | "upperFollowerCount": 400, 16 | "minBreakAfterATaskInMinutes": 1.00, 17 | "maxBreakAfterATaskInMinutes": 60.00 18 | } 19 | -------------------------------------------------------------------------------- /dashboard/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Moritz Gruber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dashboard/README.md: -------------------------------------------------------------------------------- 1 | # universialDashboard 2 | A Dashboard to Monitor Any server Application With Socket.io,Node.js and Vue.js 3 | -------------------------------------------------------------------------------- /dashboard/dashboard-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/dashboard/dashboard-img.png -------------------------------------------------------------------------------- /dashboard/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | var http = require('http').Server(app); 4 | var io = require('socket.io')(http); 5 | var port = process.env.PORT || 3000; 6 | var remoteJobSocket = undefined; 7 | app.use("/", express.static(__dirname + '/public')); 8 | 9 | 10 | 11 | io.on('connection', function (socket) { 12 | socket.on('update', function (data, key) { 13 | if (typeof key === 'string' || key instanceof String) { 14 | if (key == 'clubmate123') { 15 | io.emit('update', data); 16 | } 17 | } 18 | }); 19 | socket.on('connect', function () { 20 | console.log('new client connected'); 21 | }); 22 | socket.on('registerRemoteJob', function () { 23 | remoteJobSocket = socket; 24 | console.log('Server connected with socket id: ' + remoteJobSocket.id); 25 | }); 26 | socket.on('getStatistics', function (username, callback) { 27 | console.log('get stats for ' + username); 28 | remoteJobSocket.emit('getStatistics', username, callback); 29 | }); 30 | socket.on('getComments', function (topic, maxpp, maxtotal, callback) { 31 | console.log('get comments for ' + topic); 32 | remoteJobSocket.emit('getComments', topic, maxpp, maxtotal, callback); 33 | }); 34 | socket.on('getHashtags', function (topic, amountHashtags, callback) { 35 | console.log('get hashtags for ' + topic); 36 | remoteJobSocket.emit('getHashtags', topic, amountHashtags, callback); 37 | }); 38 | socket.on('getImages', function (topic, callback) { 39 | console.log('get images for ' + topic); 40 | remoteJobSocket.emit('getImages', topic, callback); 41 | }); 42 | socket.on('startBot', function (callback) { 43 | console.log('starting bot '); 44 | remoteJobSocket.emit('startBot', callback); 45 | }); 46 | }); 47 | 48 | 49 | http.listen(port, function () { 50 | console.log('listening on *:' + port); 51 | }); 52 | -------------------------------------------------------------------------------- /dashboard/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dashboard", 3 | "version": "1.0.0", 4 | "description": "a dashpord for running servers", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "dependencies": { 11 | "express": "^4.15.3", 12 | "modules": "^0.4.0", 13 | "socket.io": "^1.7.4" 14 | }, 15 | "author": "Moirtz Gruber", 16 | "license": "MIT" 17 | } 18 | -------------------------------------------------------------------------------- /dashboard/public/app.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,CAAE;EACA,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,UAAU;;AAGxB,IAAK;EACH,UAAU,EAAE,KAAK;EACjB,IAAI,EAAE,qBAAqB;EAC3B,UAAU,EAAE,IAAI;EAChB,MAAM,EAAE,IAAI;EAEZ,eAAW;IACT,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,mBAAI;MACF,YAAY,EAAE,GAAG;MACjB,aAAa,EAAE,GAAG;IAEpB,yBAAU;MACR,KAAK,EAAE,IAAI;MACX,MAAM,EAAE,KAAK;MACb,kCAAS;QACP,KAAK,EAAE,IAAI;MAEb,iCAAQ;QACN,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,IAAI;IAGf,2BAAY;MACV,KAAK,EAAE,IAAI;MACX,SAAS,EAAE,UAAU;MACrB,KAAK,EAAE,GAAG;MACV,MAAM,EAAE,IAAI;MACZ,6BAAE;QACA,KAAK,EAAE,IAAI;IAIf,yBAAU;MACR,KAAK,EAAE,IAAI;MAEX,KAAK,EAAE,GAAG;MACV,MAAM,EAAE,IAAI;IAGd,yBAAU;MACR,KAAK,EAAE,IAAI;MAEX,KAAK,EAAE,GAAG;IAEZ,uBAAQ;MACN,KAAK,EAAE,IAAI;MAEX,KAAK,EAAE,GAAG;IAEZ,kBAAG;MACD,KAAK,EAAE,KAAK;IAGZ,2BAAI;MACF,KAAK,EAAE,IAAI", 4 | "sources": ["app.scss"], 5 | "names": [], 6 | "file": "app.css" 7 | } -------------------------------------------------------------------------------- /dashboard/public/app.scss: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | box-sizing: border-box; 5 | } 6 | 7 | body { 8 | background: black; 9 | font: 13px Helvetica, Arial; 10 | list-style: none; 11 | height: 100%; 12 | 13 | #dashboard { 14 | float: left; 15 | width: 100%; 16 | height: 100%; 17 | div { 18 | padding-left: 2px; 19 | padding-right: 2px; 20 | } 21 | .controls { 22 | width: 100%; 23 | height: 200px; 24 | .buttons { 25 | width: 100%; 26 | } 27 | .inputs { 28 | color: white; 29 | width: 100%; 30 | } 31 | } 32 | .statistics { 33 | float: left; 34 | word-wrap: break-word; 35 | width: 20%; 36 | height: 100%; 37 | p { 38 | width: 100%; 39 | } 40 | 41 | } 42 | .comments { 43 | float: left; 44 | 45 | width: 20%; 46 | height: 100%; 47 | 48 | } 49 | .hashtags { 50 | float: left; 51 | 52 | width: 20%; 53 | } 54 | .images { 55 | float: left; 56 | 57 | width: 40%; 58 | } 59 | li { 60 | color: white; 61 | } 62 | .images { 63 | img { 64 | float: left; 65 | } 66 | } 67 | 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /dashboard/public/social-bot-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoritzGruber/instabot/67fdf34fba40a124ece1c5dfd285c4baf5305262/dashboard/public/social-bot-logo.png -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | instabot: 2 | build: . 3 | ports: 4 | - "9999:9999" 5 | 6 | 7 | -------------------------------------------------------------------------------- /installdebianvm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | apt-get install apt-transport-https ca-certificates git curl gnupg2 software-properties-common -y 3 | curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 4 | add-apt-repository \ 5 | "deb [arch=amd64] https://download.docker.com/linux/debian \ 6 | $(lsb_release -cs) \ 7 | stable" 8 | apt-get update 9 | apt-get install docker-ce -y 10 | ##docker compose 11 | curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 12 | chmod +x /usr/local/bin/docker-compose 13 | docker-compose --version 14 | git clone https://github.com/MoritzGruber/instabot.git -------------------------------------------------------------------------------- /macsetup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git submodule init 3 | git submodule update 4 | #install node 5 | cd dashboard 6 | npm install 7 | cd .. 8 | #install php modules 9 | cd app/phpapi/ 10 | composer install 11 | cd .. 12 | cd .. 13 | # install python modules 14 | pip3 install pyvirtualdisplay 15 | pip3 install selenium 16 | pip3 install clarifai 17 | pip3 install emoji 18 | pip3 install requests 19 | pip3 install socketIO-client-2 20 | 21 | 22 | #install chromedriver for mac --------------------------------------------------------------------------------