[go: nahoru, domu]

Skip to content
forked from kubo39/twitter

Low-level twitter API wrapper library for Nim

License

Notifications You must be signed in to change notification settings

dchem/twitter.nim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter Circle CI

Low-level twitter API wrapper library for Nim.

Special thanks to kubo39 for creating the package. Originally from https://github.com/kubo39/twitter

Installation

from github:

$ git clone git://github.com/dchem/twitter.nim
$ 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

 
 
 

Languages

  • Nim 100.0%