Git Product home page Git Product logo

loklak_jlib_api's Introduction

loklak_jlib_api

Build Status

This is the Loklak Java API. One Library to find them, One Library to bring them all.

What is loklak?

Loklak server scrapes data from multiple social networking websites, primarily from Twitter. The scraped data is open and can be accessed by anyone without the need of an API key!!! For more please visit http://loklak.org.

What can I do with it?

You can anonymously use the data provided by Loklak server using this library. Currently it supports the following API endpoints:

Dependencies

It depends on joda and json libraries which are included in android by default. If you want to use this library in an android project, you therefore have zero dependencies. If you want to use this library in any other java project, just include the jar files in the lib folder.

How to build the library

After successful build using maven, jar file can be found in target folder. Building and testing in command line and different IDEs:

  • Using command line:

    $ mvn clean package # to build
    $ mvn clean compile test # to run unit-test
  • In eclipse:

    • Right click on Project name in package explorer > Run as > Maven Build ... > Write clean package in goals. Use the created run configuration to generate the jar file.
    • Right click on Project name > Run as > Maven Test
  • In IntelliJ IDEA:

    • View > Tool Windows > Maven Projects > Lifecycle > Select the required lifecycle.

How to use it?

Its as simple as:

public class LoklakApiUse {
    
    public static void main(String[] argv) {
        String baseUrl = "https://api.loklak.org";
        // API methods are generated by the library.
        LoklakAPI loklakApi = APIGenerator.createApiMethods(LoklakAPI.class, baseUrl);
        
        // using the hello API endpoint, request url: http://api.loklak.org/api/hello.json
        JSONOBject helloReply = loklakApi.hello(); // use the required API endpoint with parameters
        System.out.println(helloReply.toString());
        
        // similarly search API endpoint, request url: https://api.loklak.org/api/search.json?q=fossasia
        JSONObject searchReply = loklakApi.search("fossasia");
        System.out.println(searchReply.toString());
    }
}

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.