[twitter-dev] Official Twitter Widget and rate limit

2011-07-03 Thread CD
I notice that there is an officially released twitter widget that ate
up my rate limit and caused my dev app to get rate limited.  I think
this widget is not cool and if enough people put this up on the
webpage everyone will end up getting rate limited.  Basically I don't
think I should get rate limited solely by visiting a webpage that
isn't even mine.

This is the widget:
http://widgets.twimg.com/j/2/widget.js

/**
 * Twitter - http://twitter.com
 * Copyright (C) 2010 Twitter
 * Author: Dustin Diaz (dus...@twitter.com)
 *
 * V 2.2.5 Twitter search/profile/faves/list widget
 * http://twitter.com/widgets
 * For full documented source see 
http://twitter.com/javascripts/widgets/widget.js
 * Hosting and modifications of the original source IS allowed.
 *

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Streaming JSON and character encodings

2011-07-03 Thread CD
my twitter text is being delivered with a < whereas the tweet in
twitter displays the <.  Is this supposed to be decoded by the JSON
parser?  Or do I need to run a HTMLDecode() on the text field myself?

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Best C/C++ library for Twitter JSON?

2011-06-30 Thread CD
Solution: Update boost to latest version.

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Best C/C++ library for Twitter JSON?

2011-06-29 Thread CD
Is there a defacto C/C++ library that can handle twitter's streaming
JSON?  I tried real quick as a test to see if I can pipe my twitter
feed to boost's JSON parser. No dice. My JSON parser cannot handle the
following lines:

"profile_background_image_url":"http:\/\/a2.twimg.com\/
profile_background_images\/4531792\/wallpaper_stock.jpg",
"url":"http:\/\/on.fb.me\/bShBVQ",
exception error: "invalid escape sequence"

"id":86162751646482432,
exception error: "expected value"
Removing the offending lines gets a populated property tree. Obviously
not sufficient for twitter. Here is the code in case I declared my
property tree wrong. Help?

int main (int argc, char * const argv[])
{
boost::property_tree::basic_ptree pt;
std::ifstream f;
f.open("testJSON2a.txt");
if(!f.is_open())
{
std::cout << "Error";
return 0;
}

try
{
boost::property_tree::json_parser::read_json(f,pt);
 
boost::property_tree::basic_ptree::const_iterator
iter = pt.begin(),iterEnd = pt.end();
for(;iter != iterEnd;++iter)
{
std::cout << iter->first << " " << iter-
>second.get_value() << std::endl;
}
}
catch(boost::property_tree::json_parser::json_parser_error &je)
{
std::cout << "Error parsing: " << je.filename() << " on line:
" << je.line() << std::endl;
std::cout << je.message() << std::endl;
}
return 0;
}


I can probably fix these two exceptions, but I have a feeling there
may be countably many other issues down the road with this approach.

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Re: Need basic help with https://userstream.twitter.com/2/user.json

2011-06-29 Thread CD
figured it out on my own.  must use HTTP GET with OAuth params passed
in URI string.  Not mentioned in the documentation.  Wasted many hours
figuring out this stuff would be clarified if someone updated the docs
and made some examples.

On Jun 29, 2:03 pm, CD  wrote:
> I have successfully implemented oauth and have used
> /statuses/update
> /friendships/create
>
> I was also able to connect to  
> http://stream.twitter.com/1/statuses/sample.json
> using Basic Auth on HTTP.
>
> However, when I try to connect tohttps://userstream.twitter.com/2/user.json
> with HTTPS and OAuth as required in the documentation, I get back ZERO
> data.  I try fiddling with the input and the best I could get is
> Unauthorized response.
>
> I am pretty much doing the OAuth the same way as other requests,
> trying POST and GET.  I put OAuth in the header
>
> baseURI = urlencode(https://userstream.twitter.com/2/user.json)
>
> Authorization: OAuth oauth_callback=oob,
> oauth_consumer_key=, oauth_nonce=9rEAx8760yc0IQYC0HCm,
> oauth_signature=Q385vY3GL9GzkppBAqEildZIKJw%3D,
> oauth_signature_method=HMAC-SHA1, oauth_timestamp=1309370434,
> oauth_token=, oauth_version=1.0

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] Need basic help with https://userstream.twitter.com/2/user.json

2011-06-29 Thread CD
I have successfully implemented oauth and have used
/statuses/update
/friendships/create

I was also able to connect to  http://stream.twitter.com/1/statuses/sample.json
using Basic Auth on HTTP.

However, when I try to connect to https://userstream.twitter.com/2/user.json
with HTTPS and OAuth as required in the documentation, I get back ZERO
data.  I try fiddling with the input and the best I could get is
Unauthorized response.

I am pretty much doing the OAuth the same way as other requests,
trying POST and GET.  I put OAuth in the header

baseURI = urlencode(https://userstream.twitter.com/2/user.json)

Authorization: OAuth oauth_callback=oob,
oauth_consumer_key=, oauth_nonce=9rEAx8760yc0IQYC0HCm,
oauth_signature=Q385vY3GL9GzkppBAqEildZIKJw%3D,
oauth_signature_method=HMAC-SHA1, oauth_timestamp=1309370434,
oauth_token=, oauth_version=1.0

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk