Loklak: It’s not just an application

Loklak is not just an application. It is a server based application capable of scraping messages from Twitter unofficially and other sources. This server contains a search index and a peer-to-peer index sharing interface. It is available as a local host server, API and webclient.  The loklak server can be cloned from the repo present on github and can be run on localhost using Apache ANT.

Some of the highlights of loklak are:

  • It’s architecture is very generic and can be used for any twitter like platform.
  • Loklak is anonymous, as it doesn’t store client’s IP address when a search is done (thanks to the use of scrapers).
  •  Loklak can recursively de-shorten shortened links (so as to free up some more characters).
  • One can create an own search engine for tweets.

Next coming on to the loklak API, it is very much flexible and can be easily implemented. There are existing API libraries with support in Node.js, Python, C#.Net and Ruby in order to use the loklak API. The loklak being based on http is very much ubiquitous. One can access the loklak API without any authentication, but there exist three classes for access rights which are:

  1. open: access without any restrictions for all clients from any IP
  2. limited: localhost clients are granted more data than public clients
  3. restricted: only localhost clients are granted access

The loklak APIs that are currently available are:

  • status.json [with no access restrictions]
  • search.json [with no access restrictions]
  • suggest.json [with some access restictions]
  • crawler.json [with some access restrictions]
  • hello.json [with no access restrictions]
  • geocode.json [with no access restictions]
  • peers.json [with no access restrictions]
  • proxy.json [with some access restrctions]
  • push.json [with some access restrictions]
  • push/geojson.json [with no access restrcitions]
  • push/”.” [with no access restrictions]
  • import.json [with no access restrictions]
  • validate.json [with no access restrictions]
  • settings.json [with some access restrictions]
  • account.json [with some access restrictions]
  • user.json [with no access restrictions]
  • asset [with some access restrictions]
  • threaddump.txt [with some access restrictions]
  • vis/map.png [with no access restrictions]
  • vis/markdown.png [with no access restricions]

The search results on loklak can be retrieved in two formats: JSON and RSS. 

The following is a sample search result in JSON:

  "readme_1" : "loklak.org is the framework for a message search system, not the portal, read: http://loklak.org/about.html#notasearchportal",
  "readme_2" : "This is supposed to be the back-end of a search portal. For the api, see http://loklak.org/api.html",
  "readme_3" : "Parameters q=(query), source=(cache|backend|twitter|all), callback=p for jsonp, maximumRecords=(message count), minified=(true|false)",
  "search_metadata" : {
    "itemsPerPage" : "1",
    "count" : "1",
    "count_twitter_all" : 0,
    "count_twitter_new" : 0,
    "count_backend" : 0,
    "count_cache" : 7336,
    "hits" : 7336,
    "period" : 9223372036854775807,
    "query" : "fossasia",
    "client" : "",
    "time" : 1196,
    "servicereduction" : "false",
    "scraperInfo" : "local"
  "statuses" : [ {
    "timestamp" : "2016-04-21T17:33:06.959Z",
    "created_at" : "2016-04-21T15:39:39.000Z",
    "screen_name" : "notrademark",
    "text" : "@fossasia @mariobehling sure, I am happy about every pull request on GitHub. What features do you plan?",
    "link" : "https://twitter.com/notrademark/status/723174364968005632",
    "id_str" : "723174364968005632",
    "source_type" : "USER",
    "provider_type" : "REMOTE",
    "provider_hash" : "1cadbfd3",
    "retweet_count" : 0,
    "favourites_count" : 0,
    "images" : [ ],
    "images_count" : 0,
    "audio" : [ ],
    "audio_count" : 0,
    "videos" : [ ],
    "videos_count" : 0,
    "place_name" : "Planá",
    "place_id" : "",
    "place_context" : "FROM",
    "location_point" : [ 12.743780125278874, 49.86816018348006 ],
    "location_radius" : 0,
    "location_mark" : [ 12.74180946741263, 49.86938948602838 ],
    "location_source" : "PLACE",
    "hosts" : [ ],
    "hosts_count" : 0,
    "links" : [ ],
    "links_count" : 0,
    "mentions" : [ "fossasia", "mariobehling" ],
    "mentions_count" : 2,
    "hashtags" : [ ],
    "hashtags_count" : 0,
    "classifier_language" : "english",
    "classifier_language_probability" : 2.7384035E-14,
    "without_l_len" : 103,
    "without_lu_len" : 79,
    "without_luh_len" : 79,
    "user" : {
      "screen_name" : "notrademark",
      "user_id" : "2374283574",
      "name" : "msquare",
      "profile_image_url_https" : "https://pbs.twimg.com/profile_images/514057179737772032/OPi1EgNA_bigger.png",
      "appearance_first" : "2015-08-17T02:42:20.874Z",
      "appearance_latest" : "2015-08-17T02:42:20.874Z"
  } ],
  "aggregations" : { }

The following is a sample search result in RSS:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
<title>RSS feed for Twitter search for Divine</title>
<pubDate>Sat, 11 Jun 2016 08:48:49 +0000</pubDate>
<title>• Harley • @sunreymb</title>
<description>@Sick_and_Divine YOU WERE SO SQUEAMISH</description>
<pubDate>Sat, 11 Jun 2016 08:48:19 +0000</pubDate>
<guid isPermaLink="false">741552632200757249</guid>
<title>siya nyengane @siya_nyengane</title>
<description>6pm the divine encounter. I hope you will be a blessing again today. Love your show. Blessings to you. @Franklites</description>
<pubDate>Sat, 11 Jun 2016 08:48:19 +0000</pubDate>
<guid isPermaLink="false">741552630502154240</guid>
<title>Total OneEighty @Total_180</title>
<pubDate>Sat, 11 Jun 2016 08:48:18 +0000</pubDate>
<guid isPermaLink="false">741552626576297988</guid>
<title>[email protected] @divine_KH8</title>
<pubDate>Sat, 11 Jun 2016 08:48:15 +0000</pubDate>
<guid isPermaLink="false">741552615213916160</guid>
<title>Uhoh It's Dad! @DigBeingADad</title>
<description>To err is human, to compute divine. Trust your computer but not its programmer. ― Morris Kingston</description>
<pubDate>Sat, 11 Jun 2016 08:48:01 +0000</pubDate>
<guid isPermaLink="false">741552554660659201</guid>
<title>ActusCulture @Actus_Culture</title>
<description>Musique sacrée: Gildas Avegozard Onina innove avec son opus « Divine Bonté » #culture</description>
<pubDate>Sat, 11 Jun 2016 08:47:59 +0000</pubDate>
<guid isPermaLink="false">741552549149474817</guid>
<title>John @Sick_and_Divine</title>
<description>Me: I love gore. It can be pretty fucking hot</description>
<pubDate>Sat, 11 Jun 2016 08:47:39 +0000</pubDate>
<guid isPermaLink="false">741552464055308288</guid>
<title>[email protected] @divine_KH8</title>
<pubDate>Sat, 11 Jun 2016 08:47:38 +0000</pubDate>
<guid isPermaLink="false">741552462008459264</guid>
<title>paul tims @1lengua222</title>
<description>@FoxxxBabesLive @candydeevine candy really is DIVINE</description>
<pubDate>Sat, 11 Jun 2016 08:47:34 +0000</pubDate>
<guid isPermaLink="false">741552442958045184</guid>
<title>AQUARIUS Astrology @AquariusUnite</title>
<description>When an #Aquarian is confident, they radiate a divine energy that is unstoppable.</description>
<pubDate>Sat, 11 Jun 2016 08:47:04 +0000</pubDate>
<guid isPermaLink="false">741552316143173632</guid>
<title>Xander @XanderGems</title>
<description>Loved this song for a whole year now! This will never get old to me</description>
<pubDate>Sat, 11 Jun 2016 08:47:00 +0000</pubDate>
<guid isPermaLink="false">741552299789721601</guid>
<title>Esmeralda♡ @divine__es</title>
<description>Where you're locked out of you own room &amp; have to go in from outside. #sketchmuch</description>
<pubDate>Sat, 11 Jun 2016 08:46:55 +0000</pubDate>
<guid isPermaLink="false">741552277559738368</guid>
<title>★ Hope Estheim 彡 @TheHopefulBot</title>
<description>“Clear the way.” — Upon using Divine Judgement</description>
<pubDate>Sat, 11 Jun 2016 08:46:44 +0000</pubDate>
<guid isPermaLink="false">741552234559766531</guid>
<title>Lucifer news @Lucifenews24</title>
<description>Comic Book Review - The Wicked + The Divine #20... http://prt.news/amfcL7</description>
<pubDate>Sat, 11 Jun 2016 08:46:22 +0000</pubDate>
<guid isPermaLink="false">741552141559439360</guid>
<title>Piyush Puri @piyushpuri12</title>
<description>#DCShoesIndia #NewStore #CityOfJoy&lt;/a</description>
<pubDate>Sat, 11 Jun 2016 08:46:20 +0000</pubDate>
<guid isPermaLink="false">741552132986306565</guid>
<title>John @Sick_and_Divine</title>
<description>Never thought I'd ever see the day I'd watch somebody finger a heart but that day came</description>
<pubDate>Sat, 11 Jun 2016 08:46:01 +0000</pubDate>
<guid isPermaLink="false">741552053055459328</guid>
<title>Roxyychixx @YasminEntice</title>
<description>tatak divine hahah choss https://twitter.com/angtanongkosayo/status/741543513196630017</description>
<pubDate>Sat, 11 Jun 2016 08:46:00 +0000</pubDate>
<guid isPermaLink="false">741552050794729472</guid>
<title>Shruti :) @Divine_Shruti</title>
<description>@WestlandBooks @storytellersavi i'm liking this !!!</description>
<pubDate>Sat, 11 Jun 2016 08:45:55 +0000</pubDate>
<guid isPermaLink="false">741552026870386688</guid>
<title>[email protected] @divine_KH8</title>
<pubDate>Sat, 11 Jun 2016 08:45:36 +0000</pubDate>
<guid isPermaLink="false">741551946872426496</guid>
<title>da13thsun™ @da13thsun</title>
<description>The evolving soul is not made divine by what it does, but by what it strives to do</description>
<pubDate>Sat, 11 Jun 2016 08:45:25 +0000</pubDate>
<guid isPermaLink="false">741551903033659392</guid>


While harvesting tweets, the Twitter will act as the source, the loklak API will provide with the distributed peer – to – peer infrastructure and ElasticSearch will work as the search index. Whenever scraping is done,  the JSON dump becomes a very large collection of archived tweets. This can be used with a search portal like Kibana which provides the front-end experience.

Loklak has been already implemented for Twitter and in the near future, we are planning to implement it on other platforms such as Instagram, Wikipedia and possibly wherever  good amount of data dumps are available.

Loklak !!




Loklak: It’s not just an application