Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yukihirai0505/iservice
:laughing: do instagram actions programmatically
https://github.com/yukihirai0505/iservice
bash instagram sbt scala
Last synced: 2 days ago
JSON representation
:laughing: do instagram actions programmatically
- Host: GitHub
- URL: https://github.com/yukihirai0505/iservice
- Owner: yukihirai0505
- License: mit
- Created: 2017-05-27T03:48:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T08:00:41.000Z (over 6 years ago)
- Last Synced: 2024-11-11T21:12:04.834Z (4 days ago)
- Topics: bash, instagram, sbt, scala
- Language: Scala
- Homepage:
- Size: 279 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
To get instagram all followers.
## Setup
sbt
If you don't have it already, make sure you add the Maven Central as resolver in your SBT settings:
You need to include the library as your dependency:
```scala
libraryDependencies += "com.yukihirai0505" % "iservice_2.11" % "2.0.0"
```https://search.maven.org/#artifactdetails%7Ccom.yukihirai0505%7Ciservice_2.11%7C2.0.0%7Cjar
## Example
Using browser url
### Using scala
```scala
import java.io.Fileimport com.yukihirai0505.iService.IService
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.globalval (username, password) = (sys.env("INSTAGRAM_USERNAME"), sys.env("INSTAGRAM_PASSWORD"))
val iService = new IService(username, password)// Get followers
iService.getFollowers(targetAccountName = "[target account name]").flatMap {
case Right(result) => Future successful result.foreach(n => println(n.node.username))
case Left(_) => Future successful "failed"
}// Get hash tag search result
iService.getSearchHashTagResult(hashTag = "[hash tag]").flatMap {
case Right(v) => Future successful v.media.nodes.foreach(println)
case Left(e) => Future successful "failed"
}// Like to media
iService.likeMedia(mediaId = "[media id]", "[shortcode]").flatMap {
case Right(v) => Future successful println(v.status)
case Left(e) => Future successful println("failed", e)
}// Post to timeline
iService.postNaturalWays(new File("path/to/post"), "test").flatMap {
case Right(v) => Future successful println(s"result:${v.status} code: ${v.code}")
case Left(e) => Future successful println("failed", e)
}
```