Giter VIP home page Giter VIP logo

go-twitter's Introduction

go-twitter

go-twitter is a Twitter library package for Go. The interface is similar to python-twitter.

Installation

  1. Make sure you have Go installed and your environment is set up correctly: $GOROOT, $GOARCH, $GOBIN, etc.
  2. Checkout the code from the repository or extract the source code.
  3. cd go-twitter && make install

Quick Start

import (
  "go-twitter"
  "fmt"

)
// Prints the public timeline
func main() {
  api := twitter.NewApi();
  pubTimeline := <-api.GetPublicTimeline();

  for i, status := range pubTimeline {
    fmt.Printf("#%d %s: %s\n", i,
              status.GetUser().GetScreenName(),
              status.GetText());
  }
}

Documentation

doc/ - godoc generated files, site coming soon

go-twitter's People

Contributors

cnbuff410 avatar jb55 avatar pseudopresence avatar sridif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-twitter's Issues

Why are some requests launched on separate goroutines?

For instance:

 limit := <- api.GetRateLimitInfo()
 twuser := <- api.GetUser("hoisie")

Just curious why you chose this model. I'm having a hard time coming up with a use case where it's advantageous to delay receiving the data.

Go-Twitter doesn't compile with latest ReadResponse changes

/Users/mike/apps/bin/8g -o go.8 api.go status.go user.go hacks.go search.go util.go rate_limit.go http_auth.go
http_auth.go:68: not enough arguments to CALL
make: *** [go.8] Error 1

You need to change the line to this:

resp, err = http.ReadResponse(reader, req.Method)

status.GetCreatedAtInSeconds returns 0

The following code prints 0, when it should print the seconds when the status was posted:

 package main

 import "twitter"

 func main() {

    api := twitter.NewApi()
     api.SetCredentials( "user", "pass")
     twuser := <- api.GetUser("user")
     status := twuser.GetStatus()
     println( status.GetCreatedAtInSeconds()  )
 }

Some json results include unparsed char data

In my twitter crawler I've been noticing that some messages contain xml char data tags like &lt, &gt, เตŸ e

Go has a parser than can convert these to normal strings. However, it's part of the XML unmarshal function.

Is there a strict reason why you're using json as the encoding mechanism? It seems that if you make xml requests, the data would be converted more efficiently to a Go string.

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.