Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
/ twitter Public archive

Low-level twitter API wrapper library for Nim

License

Notifications You must be signed in to change notification settings

kubo39/twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter Circle CI

Low-level twitter API wrapper library for Nim.

Installation

from github:

$ git clone git://github.com/kubo39/twitter
$ cd twitter.nim && nimble install

Example

import twitter, json, strtabs

when isMainModule:
  var parsed = parseFile("credential.json")

  var consumerToken = newConsumerToken(parsed["ConsumerKey"].str,
                                       parsed["ConsumerSecret"].str)
  var twitterAPI = newTwitterAPI(consumerToken,
                                 parsed["AccessToken"].str,
                                 parsed["AccessTokenSecret"].str)

  # Simply get.
  var resp = twitterAPI.get("account/verify_credentials.json")
  echo resp.status

  # Using proc corresponding twitter REST APIs.
  resp = twitterAPI.userTimeline()
  echo parseJson(resp.body)

  # Using `callAPI` template.
  var testStatus = {"status": "test"}.newStringTable
  resp = twitterAPI.callAPI(statusesUpdate, testStatus)
  echo parseJson(resp.body)

About

Low-level twitter API wrapper library for Nim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages