Giter VIP home page Giter VIP logo

scrava's Introduction

Scrava

A lightweight Scala client for the Strava API built upon ScalaJ-HTTP library and Lift JSON.

Build Status GitHub version

Installation

Scrava is currently built for Scala 2.11 and 2.12. To use scrava in an sbt project, add the following to your project file:

libraryDependencies += "com.github.kiambogo" %% "scrava" % "1.3.0"

Sample Code

val client = new ScravaClient("[accessToken]")
val athlete = client.retrieveAthlete()

Note: Most functions have optional ID parameters (i.e, retrieveAthlete()). If no ID is provided, the function will operate based on the currently authenticated user. Therefore, retrieveAthlete() will return the athlete profile of the currently authenticated user (based on the access token provided), and listAthleteFriends() will return the list of friends of the currently authenticated athlete.

To retrieve perform these functions for a particular athlete/activity/etc, simply pass in the respective ID: retrieveAthlete(Some([athleteID])) or listAthleteFriends(Some([athleteID])).

Auto-Pagination

The Strava API offers the ability to page through result sets when the corresponding result set to a request is very large. Scrava offers the ability to perform auto-pagination, fetching the entire result set and merging into a single List. To utilize this, simply pass in retrieveAll = true into the respective function. Note that this will use additional requests to the API, and may exhaust rate limits in some cases.


Note: The functions requiring Write permissions (updateAthlete(), createActivity(), updateActivity(), etc) are untested at this time.

If any errors or problems are found, feel free to open a pull request or issue.

scrava's People

Contributors

kiambogo avatar orium avatar rocketage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scrava's Issues

[question] Issues while installing

Hello there!

I am trying to pull in following the ProjectRef or ProjectRoot idea found out there, but it says there is no artefact available and therefore, fails due unsolved dependencies.

I've searched on MavenCentral, but there is no package there. How's the best way to install it?

I am using latest sbt and Scala version (0.13.13/2.12.1) on a brand new (pet)project.

Thanks in advance!

Fix segmentExplorer and add Integration Test

I was working with your Strava Client, and I noticed that the ScravaClient::segmentExplorer function was not working. Secondly, I also noticed it wasn't covered by an integration test.

I worked though it last night, so I should be able to send you a pull request with both of these resolved once I separate these changes from my own project.

Also, thanks for creating this! You saved me tons of time/work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.