Coder Social home page Coder Social logo

twitterizer / twitterizer Goto Github PK

View Code? Open in Web Editor NEW
220.0 54.0 175.0 36.28 MB

Twitterizer is a .NET class library that provides an easy-to-use interface for the Twitter web api. It is written for developers. It's features are easy to discover and follow a consistent design pattern.

Home Page: http://www.twitterizer.net

C# 98.39% ASP 1.26% CSS 0.15% HTML 0.07% Batchfile 0.14%

twitterizer's Introduction

Twitterizer

Example

var response = TwitterStatus.Update(credentials, "Twitterizer is fantastic!");
if (response.Result == Success)
{
	DisplaySuccessMessageFor(response.ResponseObject);
}
else
{
	DisplayErrorMessage(response.ErrorMessage);
}



var myFeed = TwitterTimeline.HomeTimeline(credentials);

History

Twitterizer started in May of 2008 as an excuse for me to explore design patterns, have a little fun coding, and stretch out my architectural legs. I never set out to create an open source library, much less a popular one (in the last 30 days of its life, Twitterizer.net pulled 8,560 unique visitors and nearly 52k views).

In 2009 the Smuxi project made use of the Twitterizer library to support Twitter as a built-in feature in their popular IRC client. As of 2013 Twitterizer is part of the Smuxi project umbrella and thus actively maintained. In August 2012 Smuxi ported Twitterizer to Newtonson.Json 4.5.8, in August 2013 Twitterizer was ported to the Twitter v1.1 API, in November 2013 proxy support was added to the Streaming API, and in Janary 2014 Twitterizer was ported to enforced HTTPS.

Plans for the future

Version 2.4.3

The next minor version will contain only high priority bug fixes while Version 3 is in development.

Version 3

  1. Drop support of Silverlight (unless developers come forward to own it)
  2. Twitterizer project to be async-only using the TPL
  3. Drop Twitterizer.OAuth library (let's face it, it's not a very great product) and, in fact:
  4. Evaluate relying upon an external OAuth library (DotNetOpenAuth, for example)
  5. Sync command classes and objects with Twitter's 1.1 documentation
  6. Redesign unit tests; properly mock objects and run tests using static json data
  7. Establish continuous deployment to Nuget

Contribute

  1. Create or claim an issue
  2. Fork the repository
  3. Create a branch named appropriately for the issue (based on the develop branch)
  4. Make happy code
  5. Submit a pull request to merge your changes to the develop branch
  6. Watch for comments or questions about your changes

Branch Naming

From now on, all work will be performed in feature or bug branches. The will follow this pattern: <issue_type>/<issue_number>-<short-description>.

For example, say I was working on issue #63, the branch would be called bug/63-fix-unit-tests

twitterizer's People

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  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  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar

twitterizer's Issues

Unknown error 9 when using twitterizer2.dll

Since the 14th of this month my embedded code using twitterizer2.dll have been failing with an error code of 9. Do you have a recompiled version of the dll that includes the "https://" connection issues, and if so where can I download the new version? Thanks so much.

Post Special Characters

Hi,

TwitterStatus.Update() throwing an could not authenticate error when you post the message with the special characters. Any solution for the same?

Regards,
Raja

twitterizer does not work with the latest version of JSON

same issue as noted here: http://forums.twitterizer.net/viewtopic.php?f=9&t=1096 , but placed in github for posterity. The actual exception i am getting is:

Unexpected token when deserializing object: StartObject. Path '[1]', line 1, position 5641.

Type = Newtonsoft.Json.JsonSerializationException

Source = Newtonsoft.Json

at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWrappedCollection wrappedList, JsonReader reader, String reference, JsonArrayContract contract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonProperty containerProperty, Object existingValue, String reference)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at Twitterizer.Core.SerializationHelper1.Deserialize(Byte[] webResponseData, DeserializationHandler deserializationHandler) at Twitterizer.Core.TwitterCommand1.ExecuteCommand()
at Twitterizer.TwitterTimeline.HomeTimeline(OAuthTokens tokens, TimelineOptions options)

Introduce a common Interface for tweetable objects

A feature from (the now defunct) TweetSharp that I'd love to see in Twitterizer:

Statuses, search results and direct messages all share some common properties. User, text, timestamp etc. It would be nice if they all implemented a common "ITweetable" (or something more in line with the Twitterizer naming conventions) so that we could define methods that can work with all three kinds of updates.

Once ITweetable existed, The corresponding collection classes like TwitterStatusCollection could implement IEnumerable<ITweetable> so that, again, methods could accept any kind of collection of updates as a parameter.

TwitterSearch.Search() returns a "Unable to parse JSON"

Hello,

In our code, we use this function :
TwitterResponse response = TwitterSearch.Search(oAuthTokens, twitterQuery, options);

Which was working perfectly until today. Today, we are getting "Unable to parse JSON" in the response.Result

I confirm that input parameters are strictly the very same as yesterday and the days before. I know Twitter API is not always stable but this sounds strange to me we get an error "Unable to parse JSON".

I checked the library of Newtonsoft.Json and saw that Twitterizer uses an old version, however it is impossible to upgrade Newtonsoft.Json from nuget because of Twitterizer.

Does anybody else has such issues ? Do you plan supporting the latest release of Newtonsoft.Json ?

Thank you very much in advance for your help.

Flo

Getting : "Sorry, that page does not exist" "code:34"

Just found out that none of our code for getting user tweets is working any more. From a little investigation we noticed the October 2012 api changes which I tried changing the base URL for that API request - Made no difference.

As a last resort I just grabbed the latest source and compiled my own version, and getting the exact same response back.

Code snippet :

            UserTimelineOptions userOptions = new UserTimelineOptions 
            {
                ScreenName = screenName, 
                Count = maxCount, 
                SkipUser = false
            };

            if (startingId != 0)
            {
                userOptions.SinceStatusId = startingId;
            }

            if(endingId != 0)
            {
                userOptions.MaxStatusId = endingId;
            }

            TwitterResponse<TwitterStatusCollection> timelineResponse 
                = TwitterTimeline.UserTimeline(tokens, userOptions);

Examining the return object i get the error code mentioned in the title of this post, and checking the request URL i see : http://api.twitter.com/1/statuses/user_timeline.json

Help!

StreamOptions constructor needs to be public

Right now, it's protected. This is obviously a problem, as I can't set the StreamOptions when instantiating TwitterStream... it requires passing in a StreamOptions instance... which I can't create because the constructor is protected...

What I ended up doing was creating my own CustomStreamOptions class that inherits from StreamOptions and then passing that into TwitterStream. Seems like a silly hoop to have to jump through.

TwitterStream callbacks not firing

I'm having a strange problem where the twitter stream callbacks aren't firing, similar to the one in this old forum post

http://forums.twitterizer.net/viewtopic.php?f=9&t=3747&p=5614&hilit=twitterstream#p5614

There are only two callbacks working, the initialisation one (reports friends), and the Json callback (works for everything, friends, events, new tweets etc).

I have copied the code from that post word-for-word yet it still doesn't work. Could something have broken with any changes since then?

2.4.2 NuGet packages for streaming

Hi,

I guess there's something wrong with the nuget packages.

The Twitterizer nuget package doesn't contain the streaming dll anymore. There's a package description on nuget for a Twitterizer-Streaming package, but that doesn't contain any releases.

Cheers,
Markus

HomeTimeLine generating serialization exception

Following the example here:
http://www.twitterizer.net/519/supply-optional-parameters/

Generates the following:
Newtonsoft.Json.JsonSerializationException: Unexpected token when deserializing object: StartObject. Line 1, position 1959. at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, String id) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1242 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateAndPopulateObject(JsonReader reader, JsonObjectContract contract, String id) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 957 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 433 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 236 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader reader, Type objectType, JsonContract contract, JsonConverter converter) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 221 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWrappedCollection wrappedList, JsonReader reader, String reference, JsonArrayContract contract) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 794 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.<>c__DisplayClass1.b__0(IList l, Boolean isTemporaryListReference) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 744 at Newtonsoft.Json.Utilities.CollectionUtils.CreateAndPopulateList(Type listType, Action2 populateList) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\CollectionUtils.cs:line 236 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String reference) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 495 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 238 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueNonProperty(JsonReader reader, Type objectType, JsonContract contract, JsonConverter converter) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 221 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 117 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonConvert.cs:line 734 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonConvert.cs:line 694 at Twitterizer.Core.SerializationHelper1.Deserialize(Byte[] webResponseData, DeserializationHandler deserializationHandler) at Twitterizer.Core.TwitterCommand`1.ExecuteCommand() at

Twitter API v1.1

When is it anticipated that Twitterizer will support the Twitter v1.1 API?

I've tried changing the "APIBaseAddress" to "http://api.twitter.com/1.1/" and any api calls fail with a 401 Unauthorized exception.

Twitter text being chopped off after adding RT @username

One real example. The original tweet has 140 characters:
"I am disappointed in today's #SCOTUS decision. The health care law is an overreach of the federal govt. This law must be repealed#fullrepeal"

The library appends RT @username to it, then the Text property of a TwitterStatus becomes:
"RT @GovernorBentley: I am disappointed in today's #SCOTUS decision. The health care law is an overreach of the federal govt. This law mu ..."

That is, "st be repealed#fullrepeal" was chopped off from the original tweet.

Get tailored trends

Is it possible to get the users specific Tailored Trends? I am currently using the following code to get worldwide trends:

TwitterResponse tr = TwitterTrend.Trends(1);
foreach (TwitterTrend tnds in tr.ResponseObject)
{
Label trend = new Label();
trend.Content = tnds.Name;
trend.Foreground = Brushes.White;
trend.Margin = new Thickness(10, 0, 0, 0);
TrendsBar.Children.Add(trend);
}

Twitterizer not working when a tweet contains an image/pic

This was sent in by Paul Stoker via email:

I have noticed a problem with Twitterizer in that it's has been working fine until my client added a tweet to her account containing an image powered by Photobucket.
Then we started getting the Object reference error above. It's taken a an hour or two to determine that it was actually the tweet causing the issue which I've now removed however how can I get round this problem?
My code is below which is a very basic solution for pulling the time line in:

OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = AccessToken;
tokens.AccessTokenSecret = AccessTokenSecret;
tokens.ConsumerKey = ConsumerKey;
tokens.ConsumerSecret = ConsumerSecret;

try
{
  UserTimelineOptions opts = new UserTimelineOptions();
  opts.IncludeRetweets = false;
  opts.UseSSL = true;
  opts.Count = 5;

  TwitterResponse<TwitterStatusCollection> timeLine =  TwitterTimeline.UserTimeline(tokens, opts);
  uxTweets.DataSource = timeLine.ResponseObject;
  uxTweets.DataBind();
}
catch
{
  uxError.Text = "<p class=\"p1\">Twitter isn't configured correctly. Twitter is not responding.</p>";
}

Sqlite datatype for ID's

I see you're using decimal as the data type for ID's on objects. That's all good and fine, but wondering what the actual impact is. How many decimal places should we be expecting? I'm trying to create the schema for a SQLite database and want to know what DECIMAL(X,Y) to use to store it.

Thanks!

JSON.NET 4.5

As I am using ASP.NET MVC 4 there is a dependency on JSON.NET 4.5 for the Web API features, which means I am unable to use Twitterizer - once I compile it with JSON.NET 4.5 I get the reported issues with NewtonSoft.JSON.JsonSerializationException {"Unexpected token when deserializing object: StartObject (this was on stack overflow, the old forums and in some forms here with no reply).

The Stackoverflow issue was logged here 9 months ago... http://stackoverflow.com/questions/9026705/twitterizer-twitttertimeline-newtonsoft-json-jsonserializationexception-problems

This occurs on Timeline requests.

Inconsistent types for StreamOptions vs. UserIdCollection

Apparently, UserIdCollection is storing user IDs as decimals? Any reason not to use int or long?

Also, the StreamOptions Follow property is a List<string>.

See the problem here? So, in my implementation, I have to convert the UserIdCollection from a collection of decimal to a List<string>. Seems like these should be normalized to a single type. Either return a List<string> from TwitterFriendship.FriendIds, or change StreamOptions Follow to UserIdCollection. (Although, what should probably happen is have them both normalized to List<int>, or List<long> if we think twitter will get over 2 billion users.)

Coordinate Json Converter fails on 0,0

Coordinate.cs

When parsing a tweet with the following coordinates fragment,
{ "coordinates" : [ 0,
0
],

a "Specified cast is not valid." exception is thrown:
(double)reader.Value Cannot unbox '((Newtonsoft.Json.JsonTextReader)reader).Value' as a 'double'

  • using Convert.ToDouble( reader.Value) fixes

PS am using Json.Net 4.0.3


Too bad if one is tweeting for help from the Gulf of Guinea :-)

Streaming event not handling access_revoked event correctly.

Example (sanitised) json event response. To replicate revoke any client app on Twitter.com Settings.

{
"target_object": {
"token": "xx",
"client_application": {
"name": "ifttt",
"url": "http://ifttt.com",
"consumer_key": "xx",
"id": 177000
}
},
"target": {
"default_profile_image": false,
"id": 8064682,
"screen_name": "ltibbets",
"time_zone": "Pacific Time (US & Canada)",
"profile_background_tile": false,
"favourites_count": 3,
"contributors_enabled": false,
"profile_sidebar_fill_color": "ffffff",
"geo_enabled": true,
"profile_image_url": "http://a0.twimg.com/profile_images/1678558321/temp1323241261strip20111206-29103-bzc4rs_normal",
"utc_offset": -28800,
"followers_count": 756,
"name": "Linden Tibbets",
"show_all_inline_media": false,
"profile_image_url_https": "https://si0.twimg.com/profile_images/1678558321/temp1323241261strip20111206-29103-bzc4rs_normal",
"profile_background_color": "ffffff",
"follow_request_sent": false,
"verified": false,
"protected": false,
"default_profile": false,
"lang": "en",
"profile_background_image_url": "http://a0.twimg.com/profile_background_images/94186664/bg.png",
"url": "http://lindentibbetswashere.com/",
"profile_link_color": "0000ff",
"description": "is building something cool.",
"created_at": "Wed Aug 08 21:12:09 +0000 2007",
"listed_count": 32,
"profile_use_background_image": true,
"id_str": "8064682",
"profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/94186664/bg.png",
"friends_count": 145,
"profile_text_color": "1a1a1a",
"following": false,
"is_translator": false,
"location": "San Francisco, CA",
"notifications": false,
"statuses_count": 991,
"profile_sidebar_border_color": "ffffff"
},
"created_at": "Wed Apr 04 14:24:32 +0000 2012",
"event": "access_revoked",
"source": {
"default_profile_image": false,
"id": 11752392,
"screen_name": "GoldenTao",
"time_zone": "Brisbane",
"profile_background_tile": false,
"favourites_count": 5,
"contributors_enabled": false,
"profile_sidebar_fill_color": "ffffff",
"geo_enabled": true,
"profile_image_url": "http://a0.twimg.com/profile_images/1706128554/eightbit-eefff8cc-9bd1-41eb-bc30-bc024a569d34_normal.png",
"utc_offset": 36000,
"followers_count": 1052,
"name": "David Golden",
"show_all_inline_media": true,
"profile_image_url_https": "https://si0.twimg.com/profile_images/1706128554/eightbit-eefff8cc-9bd1-41eb-bc30-bc024a569d34_normal.png",
"profile_background_color": "B2DFDA",
"follow_request_sent": false,
"verified": false,
"protected": false,
"default_profile": false,
"lang": "en",
"profile_background_image_url": "http://a0.twimg.com/images/themes/theme13/bg.gif",
"url": "http://www.goldentao.net",
"profile_link_color": "93A644",
"description": "Software Dev Manager for @BusinessFitness, Lead Developer of @MetroTwitApp, contributor to @Twit_er_izer and a dork in my spare time.",
"created_at": "Wed Jan 02 12:35:11 +0000 2008",
"listed_count": 49,
"profile_use_background_image": true,
"id_str": "11752392",
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme13/bg.gif",
"friends_count": 842,
"profile_text_color": "333333",
"following": false,
"is_translator": false,
"location": "Brisbane, Australia",
"notifications": false,
"statuses_count": 8946,
"profile_sidebar_border_color": "eeeeee"
}
}

Error: Unexpected token when deserializing object: Null. Path '[23].place', line 1, position 53264

Getting this error in the DeserializeObject line. I have the latest Newtonsoft Json (4.5.11) via Nuget and the latest dev version of Twitterizer2. This is the content that the Twitterizer API gives me that I save in the database and then Deserialize.

I can post the string here if that helps

if (cache.TweetCount > 0 && !String.IsNullOrWhiteSpace(cache.TimelineContent) && cache.TimelineContent.Trim() != "[]")
{
try
{
statuses = Newtonsoft.Json.JsonConvert.DeserializeObject(cache.TimelineContent);
}
catch (Exception ex)
{
// Unexpected token when deserializing object: Null. Path '[23].place', line 1, position 53264.
}
}

Add additional search result properties to TwitterSearchResultCollection

The Search method currently returns Tweet data, but not additional attributes like max_id, page, etc. I'd like to add these properties to the TwitterSearchResultCollection.

{
  "completed_in":0.031,
  "max_id":122078461840982016,
  "max_id_str":"122078461840982016",
  "next_page":"?page=2&max_id=122078461840982016&q=blue%20angels&rpp=5",
  "page":1,
  "query":"blue+angels",
  "refresh_url":"?since_id=122078461840982016&q=blue%20angels",

I plan to follow the same pattern that exists in TwitterUserCollection.DeserializeWrapper to populate NextCursor and PreviousCursor.

Getting Retweets

I tried to getting retweets of specific tweet. When I tried TwitterStatus.Retweets(token, tweet.TweetId) like this, it throws NullReferanceExaptation - (Object reference not set to an instance of an object) and site was crashed then I tried like TwitterStatus.Retweets(token, tweet.TweetId, new RetweetsOptions()) this and it worked.

Incorrect filesize in UpdateProfileImageCommands

I noticed a mistake in UpdateProfileImageCommands in Twitterizer2.

Length returns the file size in bits. Not bytes. So by checking if the image is larger than 89600 bits, you actually limiting the users to files smaller than 88kb.

The correct integer is 716800.

Get favourite count of TwitterStatus

I am using the following code to get the count of retweets of a status but cannot seem to get the count of favourites.

RetweetCount.Text = TwitterStatus.RetweetCountString;

Automatic Retry

Add methods to automatically retry POST/DELTE methods.

These would probably need to be modifications to the async methods, since it's probably bad to make the calling code wait for something that may not happen.

Compatibility/Dependency with Newtonsoft's latest version

First off, LOVE Twitterizer...
That being said, I need access to other libraries (Twilio in particular) that are dependent upon Newtonsoft v4.5.10.

Will you be updating Twitterizer or modifying the Nuget package to support this or are their compatibility issues in newer Newtonsoft component that will prevent this from working?

Kinda new to the whole Nuget thing and I must say, it doesn't appear to make things easier...

.NET 4.5 new Uri unescaping double dot when there's inverted question mark

I have the next problem. I'm trying to post the an status to twitter that contains an inverted question mark and a link. For instance, "¿http.www.google.com".

I'm using twitterizer for posting to twitter but when I try to post it, twitter response is "Could not authenticate you". Debugging twitterizer I have discovered that the problem is that when the Uri for making the request to Twitter is being built with the next string:

string correctUri = "http://api.twitter.com/1.1/statuses/update.json?status=%C2%BFhttp%3A%2F%2Fwww.google.com";

That's correct, every special character is escaped and everything is fine. But when new Uri is done with that string, then it comes the problem:

Uri uri =new Uri(correctUri);

Because the AbsoluteUri value is http://api.twitter.com/1.1/statuses/update.json?status=%C2%BFhttp:%2F%2Fwww.google.es . As you can see, it shows "http:" and that's exactly the problem.

I have tried the same exact code under .NET 4.5 and .NET 4 and it's only a problem under .NET 4.5. I also tried to post the same text under the two versions of .NET and it only works under .NET 4 and the only difference at the http request made to twitter (captured with fiddler) is the double dot.

I have discovered also that the problem only happens when you put an inverted question mark (%C2%BF in UTF-8) at the status. But when you don't put it, there's no problem at all.

Is there any solution to this problem? I have tried so many things, but nothing works.

Search result tweets with geo data have 0 for longitude and longitude value for latitude

After performing a TwitterSearch.Search, any returned TwitterStatus with TwitterGeo results in property Geo deserialized from JSON geo having 0 for the TwitterGeo.Coordinate.Longitude property and whatever the deserialized longitude value is in the TwitterGeo.Coordinate.Latitude property.

Twitterizer-develop\Twitterizer2\Methods\Geo\Coordinate.cs line 114 advances the reader without first reading its value. That value is latitude. Once advancing into the loop, the value pushed into the latitude property is actually longitude. Turning the while loop into a do...while loop solves the problem, though I am not sure if that's optimal or not.

Cheers.

Unit tests fail

Unit tests in main lib fail. These must be passing for releases to be considered.
(Note to self: I wish there was a way of making issues "stickies" in Github)

Unable to Parse Json

I'm running a .Net 4 website, I've installed twitterizer from nuget
"install-package twitterizer"
which has installed version 2.4.2 and Newtonsoft.Json v4.5.5

When I run the code:
UserTimelineOptions options = new UserTimelineOptions();
options.ScreenName = twitterId;
options.Count = _tweetCount;

var timeline = TwitterTimeline.UserTimeline(options);

timeline.Result = Unknown
and ErrorMessage = "Unable to parse JSON"

TwitterRateLimitStatus is not behaving as expected

The values returned by the TwitterRateLimitStatus.GetStatus(tokens), TwitterUser.Lookup(tokens, options).RateLimiting and TwitterSearch.Search(tokens, "Demojzes", options).RateLimiting are different in all three cases. This worked fine until a week ago. I've created a sample application that demonstrates this behaviour:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Twitterizer;

namespace TwitterizerTest
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                OAuthTokens tokens = GetTokens();
                GetTwitterRateStatusFromTwitter(tokens);
                TestUsers(tokens);
                GetTweets(tokens);
                Console.ReadLine();
            }
        }

        private static OAuthTokens GetTokens()
        {
            OAuthTokens tokens = new OAuthTokens();
            tokens.ConsumerKey = "*Token*";
            tokens.ConsumerSecret = "*Token*";
            tokens.AccessToken = "*Token*";
            tokens.AccessTokenSecret = "*Token*";
            return tokens;
        }

        private static void GetTwitterRateStatusFromTwitter(OAuthTokens tokens)
        {
            TwitterRateLimitStatus status = TwitterRateLimitStatus.GetStatus(tokens).ResponseObject;
            WriteStatus("GetStatus Method", status);
        }

        private static void WriteStatus(String title, TwitterRateLimitStatus status)
        {
            Console.WriteLine();
            Console.WriteLine(title);
            Console.WriteLine(String.Format("    [Annotations: {0}]", status.Annotations));
            Console.WriteLine(String.Format("    [Hourly Limit: {0}]", status.HourlyLimit));
            Console.WriteLine(String.Format("    [Remaining Hits: {0}]", status.RemainingHits));
            Console.WriteLine(String.Format("    [Reset Time: {0}]", status.ResetTime));
        }

        private static void WriteRateLimiting(String title, RateLimiting status)
        {
            Console.WriteLine();
            Console.WriteLine(title);
            Console.WriteLine(String.Format("    [Hourly Limit: {0}]", status.Total));
            Console.WriteLine(String.Format("    [Remaining Hits: {0}]", status.Remaining));
            Console.WriteLine(String.Format("    [Reset Time: {0}]", status.ResetDate));
        }

        private static void GetTweets(OAuthTokens tokens)
        {
            SearchOptions options = new SearchOptions();
            TwitterResponse<TwitterSearchResultCollection> response = TwitterSearch.Search(tokens, "Demojzes", options);

            WriteRateLimiting("Twitter Search", response.RateLimiting);
            Console.WriteLine(String.Format("    Twitter Search: Found {0} tweets for Demojzes.", response.ResponseObject.Count));
        }

        private static void TestUsers(OAuthTokens tokens)
        {
           LookupUsersOptions options = new LookupUsersOptions();

            #region Users
                options.UserIds.Add(Convert.ToDecimal(14855950));
                options.UserIds.Add(Convert.ToDecimal(234880779));
                options.UserIds.Add(Convert.ToDecimal(62540803));
                options.UserIds.Add(Convert.ToDecimal(12291122));
                options.UserIds.Add(Convert.ToDecimal(325425942));
                options.UserIds.Add(Convert.ToDecimal(452395812));
                options.UserIds.Add(Convert.ToDecimal(228691556));
                options.UserIds.Add(Convert.ToDecimal(465495968));
                options.UserIds.Add(Convert.ToDecimal(614178606));
                options.UserIds.Add(Convert.ToDecimal(26220750));
                options.UserIds.Add(Convert.ToDecimal(79179041));
                options.UserIds.Add(Convert.ToDecimal(392620070));
                options.UserIds.Add(Convert.ToDecimal(175065385));
                options.UserIds.Add(Convert.ToDecimal(82096797));
                options.UserIds.Add(Convert.ToDecimal(15596313));
                options.UserIds.Add(Convert.ToDecimal(198312276));
                options.UserIds.Add(Convert.ToDecimal(274799752));
                options.UserIds.Add(Convert.ToDecimal(110156474));
                options.UserIds.Add(Convert.ToDecimal(481177941));
                options.UserIds.Add(Convert.ToDecimal(519885364));
                options.UserIds.Add(Convert.ToDecimal(155881559));
                options.UserIds.Add(Convert.ToDecimal(487325007));
            #endregion

            if (options.UserIds.Count == 0) return;

            TwitterResponse<TwitterUserCollection> response = TwitterUser.Lookup(tokens, options);
            TwitterUserCollection users = response.ResponseObject;
            WriteRateLimiting("GetUsers Method", response.RateLimiting);
            if (users == null)
            {
                Console.WriteLine("Users object is null.");
                Console.WriteLine(String.Format("Users queried: {0}", options.UserIds.Count));
                return;
            }

            Console.WriteLine(String.Format("Users queried: {0}", options.UserIds.Count));
        }
    }
}

Twitter Media database!! preventing re-uploading files.

Hi all,
I am wondering whether is it possible that one can upload an image once and use its reference in UpdateWithMedia, instead of uploading the same file many times.
For example, I have three different twitter accounts and I want to twitt one image using Twitterizer . By using current version, UpdateWithMedia uploads the image three time (Once for each user) .
Now!
Is Twitter provides developers an access to the uploaded media ? so we can reference a file instead of uploading the same file many times.

Thanks

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.