Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enrichment failing #9

Closed
philipithomas opened this issue Oct 17, 2017 · 8 comments
Closed

Enrichment failing #9

philipithomas opened this issue Oct 17, 2017 · 8 comments

Comments

@philipithomas
Copy link
Contributor

Getting this error in production:

json: cannot unmarshal number into Go struct field .id of type string,

It's stopping this library from completing enrichment.

@philipithomas
Copy link
Contributor Author

Github ID appears to be an integer from your API, but it is a string in the user struct

@philipithomas
Copy link
Contributor Author

Oddly, the user twitter ID is an integer, and the company twitter ID is a string. That doesn't make sense @maccman :-P

@harlow
Copy link
Member

harlow commented Oct 17, 2017

@philipithomas nice catch. Agree those should def be consistent.

The integer representation of the unique identifier for this Tweet. This number is greater than 53 bits and some programming languages may have difficulty/silent defects in interpreting it. Using a signed 64 bit integer for storing this identifier is safe. Use id_str for fetching the identifier to stay on the safe side. See Twitter IDs, JSON and Snowflake .

@maccman
Copy link
Contributor

maccman commented Oct 17, 2017

Oops - should def be using strings for both.

harlow pushed a commit that referenced this issue Oct 17, 2017
Related to #9 - will report back on whether it closes it
@philipithomas
Copy link
Contributor Author

For the future, the is the best way I've seen for turning JSON into Go structs:

https://mholt.github.io/json-to-go/

@philipithomas
Copy link
Contributor Author

Might be good to set up some basic integration testing on this library because Go is tricky with JSON integrations. Basically, have it query API and assert no error. It would be best to run this daily or so (which TravisCI could do)

@philipithomas
Copy link
Contributor Author

following and followers for Twitter also incorrect type - fix incoming

@philipithomas
Copy link
Contributor Author

Does Company no longer return a URL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants