GithubHelp home page GithubHelp logo

scalali's Introduction

scalali

A scala wrapper for the linkedin REST APIs.

This makes using the LinkedIn REST APIs easier.

It uses scribe for oauth internally, and handles the authentication, request signing, parsing requests,
and returns scala objects in scala collections.

(Note, uses the great scribe-java library from https://github.com/fernandezpablo85/scribe-java)

If you want an overview, see the presentation at: http://prezi.com/1y9kflmo2wnz/scalali/

APIs supported

So far the APIs supported include:

  • Authentication
  • Profile
  • Connections
  • Voldemort API

How to use it?

A snippet from: src/scripts/demo.scala

import com.dragade.scalali._

val scalali = new ScalaLi(apiKey, secretKey)
val (url, requestToken) = scalali.initialize()
val accessToken = scalali.verify(requestToken,verifier)
val myProfile = scalali.myProfile(accessToken)
myProfile match {
case None => println(“No profile found for you!”)
case Some(p) => println(“Name: %s %s”.format(p.firstName, p.lastName))
}

//partition connections into those with pics&headlines and those without
val conns = scalali.myConnections(accessToken)
val (complete, incomplete) = conns.partition(p => p.picture.isDefined && p.headline.isDefined)
complete.foreach(p => println(“Name:%s %s\t%s\t%s”.format(p.firstName, p.lastName, p.headline.get, p.picture.get)))

To run

First get your API keys from http://developer.linkedin.com
You can edit demo.scala to use them for playing with the demo, but otherwise you’ll pass these
into ScalaLi

Then get sbt 0.11.0
from https://github.com/harrah/xsbt

Follow the instructions for creating the sbt runner script:
https://github.com/harrah/xsbt/wiki/Setup

sbt

The first time you run sbt it will download its own copy of scala 2.9.1, plus other stuff it needs.
This is separate from the version of scala you’re using yourself. Don’t worry about it.

Setting up IntelliJ

First create a file called ~/.sbt/plugins/build.sbt
with:
resolvers += “sbt-idea-repo” at “http://mpeltonen.github.com/maven/

addSbtPlugin(“com.github.mpeltonen” % “sbt-idea” % “0.11.0”)

Playing with the examples

Once you’re in sbt, you can do:
> gen-idea

this will generate the .idea files and you can then open the project in IntelliJ.
If you have the sbt plugin in IntelliJ, you can just click the green play button
to start up sbt in IntelliJ.

Playing with the Example in SBT

> compile
> console
scala> :load src/scripts/demo.scala

To build the jar
> publish

the jar is target/scala-2.9.1/scalali_2.9.1-1.0.jar

scalali's People

Contributors

li-dragade avatar

Watchers

James Cloos avatar Alvin Francis Tamie avatar  avatar

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.