Permalink
Browse files

Nuget fixes for externals for each project and source files so projec…

…t will compile

Added Friendship/NoRetweetIDs
Added Friendship/Update
Modified Friendship/Relationship to not use TwitterUser and use specific relationship objects that include all the new properties.
Removed Trends/Current 
Added Trends/WOEID
Added Trends/Available
Added Trends/Daily
Added Trends/Weekly
Added SinceStatusId to Favorites
Added InReplyToStatusID to Search Results
  • Loading branch information...
1 parent 106fac1 commit 941d2aad6b1c1a905990319d89a12466a20e291d GoldenTao committed Dec 13, 2011
Showing with 55,210 additions and 47 deletions.
  1. +15 −0 Packages.dgml
  2. +4 −0 Twitterizer.OAuth/Twitterizer.OAuth.csproj
  3. +4 −0 Twitterizer.OAuth/packages.config
  4. +6 −0 Twitterizer2.Async.Silverlight/Twitterizer2.Async.Silverlight.csproj
  5. +4 −0 Twitterizer2.Async.Silverlight/packages.config
  6. +183 −0 Twitterizer2.Async/TwitterFriendshipAsync.cs
  7. +453 −2 Twitterizer2.Async/TwitterTrendsAsync.cs
  8. +4 −0 Twitterizer2.Async/packages.config
  9. +37 −0 Twitterizer2.Silverlight/Twitterizer2.Silverlight.csproj
  10. +4 −0 Twitterizer2.Silverlight/packages.config
  11. +3 −0 Twitterizer2.Streaming.Silverlight/Twitterizer2.Streaming.Silverlight.csproj
  12. +4 −0 Twitterizer2.Streaming.Silverlight/packages.config
  13. +1 −1 Twitterizer2.TestCases/TwitterFriendshipTests.cs
  14. +1 −7 Twitterizer2.TestCases/Twitterizer2.TestCases.csproj
  15. +61 −0 Twitterizer2/Core/TwitterDictionary.cs
  16. +4 −1 Twitterizer2/Methods/Favorites/ListFavoritesCommand.cs
  17. +6 −0 Twitterizer2/Methods/Favorites/ListFavoritesOptions.cs
  18. +60 −0 Twitterizer2/Methods/Friendship/NoRetweetIDsCommand.cs
  19. +70 −0 Twitterizer2/Methods/Friendship/TwitterFriendship.cs
  20. +4 −4 Twitterizer2/Methods/Friendship/TwitterRelationship.cs
  21. +123 −0 Twitterizer2/Methods/Friendship/TwitterRelationshipUser.cs
  22. +137 −0 Twitterizer2/Methods/Friendship/UpdateFriendshipCommand.cs
  23. +68 −0 Twitterizer2/Methods/Friendship/UpdateFriendshipOptions.cs
  24. +7 −0 Twitterizer2/Methods/Search/TwitterSearchResult.cs
  25. +82 −0 Twitterizer2/Methods/Trends/AvailableTrendsCommand.cs
  26. +56 −0 Twitterizer2/Methods/Trends/AvailableTrendsOptions.cs
  27. +86 −0 Twitterizer2/Methods/Trends/DailyTrendsCommand.cs
  28. +51 −0 Twitterizer2/Methods/Trends/LocalTrendsOptions.cs
  29. +6 −5 Twitterizer2/Methods/Trends/TrendsCommand.cs
  30. +5 −6 Twitterizer2/Methods/Trends/TrendsOptions.cs
  31. +129 −5 Twitterizer2/Methods/Trends/TwitterTrend.cs
  32. +3 −3 Twitterizer2/Methods/Trends/TwitterTrendCollection.cs
  33. +152 −0 Twitterizer2/Methods/Trends/TwitterTrendDictionary.cs
  34. +30 −2 Twitterizer2/Methods/Trends/TwitterTrendLocation.cs
  35. +40 −2 Twitterizer2/Methods/Trends/TwitterTrendLocationCollection.cs
  36. +64 −0 Twitterizer2/Methods/Trends/TwitterTrendLocationPlaceType.cs
  37. +86 −0 Twitterizer2/Methods/Trends/WeeklyTrendsCommand.cs
  38. +14 −6 Twitterizer2/Twitterizer2.csproj
  39. +36 −0 Twitterizer2lite/Twitterizer2lite.csproj
  40. BIN packages/NUnit.2.5.10.11092/Logo.ico
  41. BIN packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg
  42. +277 −0 packages/NUnit.2.5.10.11092/NUnitFitTests.html
  43. +342 −0 packages/NUnit.2.5.10.11092/fit-license.txt
  44. BIN packages/NUnit.2.5.10.11092/lib/nunit.framework.dll
  45. +10,407 −0 packages/NUnit.2.5.10.11092/lib/nunit.framework.xml
  46. BIN packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll
  47. BIN packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll
  48. +15 −0 packages/NUnit.2.5.10.11092/license.txt
  49. +124 −0 packages/NUnit.2.5.10.11092/tools/NUnitTests.VisualState.xml
  50. +85 −0 packages/NUnit.2.5.10.11092/tools/NUnitTests.config
  51. +14 −0 packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit
  52. +5,971 −0 packages/NUnit.2.5.10.11092/tools/TestResult.xml
  53. +4 −0 packages/NUnit.2.5.10.11092/tools/agent.conf
  54. +18 −0 packages/NUnit.2.5.10.11092/tools/agent.log.conf
  55. +18 −0 packages/NUnit.2.5.10.11092/tools/launcher.log.conf
  56. BIN packages/NUnit.2.5.10.11092/tools/lib/Failure.png
  57. BIN packages/NUnit.2.5.10.11092/tools/lib/Ignored.png
  58. BIN packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png
  59. BIN packages/NUnit.2.5.10.11092/tools/lib/Skipped.png
  60. BIN packages/NUnit.2.5.10.11092/tools/lib/Success.png
  61. BIN packages/NUnit.2.5.10.11092/tools/lib/fit.dll
  62. BIN packages/NUnit.2.5.10.11092/tools/lib/log4net.dll
  63. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll
  64. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll
  65. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll
  66. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll
  67. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll
  68. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll
  69. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll
  70. BIN packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll
  71. BIN packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe
  72. +69 −0 packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config
  73. BIN packages/NUnit.2.5.10.11092/tools/nunit-agent.exe
  74. +69 −0 packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config
  75. BIN packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe
  76. +69 −0 packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config
  77. BIN packages/NUnit.2.5.10.11092/tools/nunit-console.exe
  78. +69 −0 packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config
  79. BIN packages/NUnit.2.5.10.11092/tools/nunit-x86.exe
  80. +83 −0 packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config
  81. BIN packages/NUnit.2.5.10.11092/tools/nunit.exe
  82. +83 −0 packages/NUnit.2.5.10.11092/tools/nunit.exe.config
  83. BIN packages/NUnit.2.5.10.11092/tools/nunit.framework.dll
  84. BIN packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe
  85. +77 −0 packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config
  86. BIN packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe
  87. +77 −0 packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config
  88. BIN packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll
  89. BIN packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll
  90. BIN packages/NUnit.2.5.10.11092/tools/runFile.exe
  91. +43 −0 packages/NUnit.2.5.10.11092/tools/runFile.exe.config
  92. +2 −0 packages/NUnit.2.5.10.11092/tools/runpnunit.bat
  93. +24 −0 packages/NUnit.2.5.10.11092/tools/test.conf
  94. BIN packages/Newtonsoft.Json.4.0.3/Newtonsoft.Json.4.0.3.nupkg
  95. BIN packages/Newtonsoft.Json.4.0.3/lib/net20/Newtonsoft.Json.dll
  96. BIN packages/Newtonsoft.Json.4.0.3/lib/net20/Newtonsoft.Json.pdb
  97. +7,859 −0 packages/Newtonsoft.Json.4.0.3/lib/net20/Newtonsoft.Json.xml
  98. BIN packages/Newtonsoft.Json.4.0.3/lib/net35/Newtonsoft.Json.dll
  99. BIN packages/Newtonsoft.Json.4.0.3/lib/net35/Newtonsoft.Json.pdb
  100. +6,982 −0 packages/Newtonsoft.Json.4.0.3/lib/net35/Newtonsoft.Json.xml
  101. BIN packages/Newtonsoft.Json.4.0.3/lib/net40/Newtonsoft.Json.dll
  102. BIN packages/Newtonsoft.Json.4.0.3/lib/net40/Newtonsoft.Json.pdb
  103. +7,141 −0 packages/Newtonsoft.Json.4.0.3/lib/net40/Newtonsoft.Json.xml
  104. BIN packages/Newtonsoft.Json.4.0.3/lib/sl3-wp/Newtonsoft.Json.dll
  105. BIN packages/Newtonsoft.Json.4.0.3/lib/sl3-wp/Newtonsoft.Json.pdb
  106. +6,574 −0 packages/Newtonsoft.Json.4.0.3/lib/sl3-wp/Newtonsoft.Json.xml
  107. BIN packages/Newtonsoft.Json.4.0.3/lib/sl4/Newtonsoft.Json.dll
  108. BIN packages/Newtonsoft.Json.4.0.3/lib/sl4/Newtonsoft.Json.pdb
  109. +6,604 −0 packages/Newtonsoft.Json.4.0.3/lib/sl4/Newtonsoft.Json.xml
  110. +7 −3 packages/repositories.config
View
15 Packages.dgml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<DirectedGraph GraphDirection="LeftToRight" xmlns="http://schemas.microsoft.com/vs/2009/dgml">
+ <Nodes />
+ <Links />
+ <Categories>
+ <Category Id="Project" />
+ <Category Id="Package" />
+ </Categories>
+ <Styles>
+ <Style TargetType="Node" GroupLabel="Project" ValueLabel="True">
+ <Condition Expression="HasCategory('Project')" />
+ <Setter Property="Background" Value="Blue" />
+ </Style>
+ </Styles>
+</DirectedGraph>
View
4 Twitterizer.OAuth/Twitterizer.OAuth.csproj
@@ -57,6 +57,9 @@
<AssemblyOriginatorKeyFile>..\Twitterizer2\Twitterizer2.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
@@ -113,6 +116,7 @@
<None Include="..\Twitterizer2\Twitterizer2.snk">
<Link>Twitterizer2.snk</Link>
</None>
+ <None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
View
4 Twitterizer.OAuth/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.0.3" />
+</packages>
View
6 Twitterizer2.Async.Silverlight/Twitterizer2.Async.Silverlight.csproj
@@ -48,6 +48,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.4.0.3\lib\sl4\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows" />
<Reference Include="system" />
@@ -119,6 +122,9 @@
<Name>Twitterizer2.Silverlight</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
View
4 Twitterizer2.Async.Silverlight/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.0.3" />
+</packages>
View
183 Twitterizer2.Async/TwitterFriendshipAsync.cs
@@ -306,5 +306,188 @@ public static IAsyncResult OutgoingRequests(OAuthTokens tokens, OutgoingFriendsh
},
null);
}
+
+ /// <summary>
+ /// Returns the numeric IDs for every user the specified user is does not want to see retweets from.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult NoRetweetIDs(OAuthTokens tokens, OptionalProperties options, TimeSpan timeout, Action<TwitterAsyncResponse<UserIdCollection>> function)
+ {
+ Func<OAuthTokens, OptionalProperties, TwitterResponse<UserIdCollection>> methodToCall = TwitterFriendship.NoRetweetIDs;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<UserIdCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+ }
+
+ /// <summary>
+ /// Returns the numeric IDs for every user the specified user is does not want to see retweets from.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult NoRetweetIDs(OAuthTokens tokens, TimeSpan timeout, Action<TwitterAsyncResponse<UserIdCollection>> function)
+ {
+ Func<OAuthTokens, TwitterResponse<UserIdCollection>> methodToCall = TwitterFriendship.NoRetweetIDs;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<UserIdCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+ }
+
+
+ /// <summary>
+ /// Updates the friendship.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="userid">The userid.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Update(OAuthTokens tokens, decimal userid, UpdateFriendshipOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterRelationship>> function)
+ {
+ Func<OAuthTokens, decimal, UpdateFriendshipOptions, TwitterResponse<TwitterRelationship>> methodToCall = TwitterFriendship.Update;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ userid,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterRelationship>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+ }
+
+ /// <summary>
+ /// Returns the numeric IDs for every user the specified user is does not want to see retweets from.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="userid">The userid.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Update(OAuthTokens tokens, decimal userid, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterRelationship>> function)
+ {
+ Func<OAuthTokens, decimal, TwitterResponse<TwitterRelationship>> methodToCall = TwitterFriendship.Update;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ userid,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterRelationship>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+ }
+
+ /// <summary>
+ /// Updates the friendship.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="screenname">The screenname.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Update(OAuthTokens tokens, string screenname, UpdateFriendshipOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterRelationship>> function)
+ {
+ Func<OAuthTokens, string, UpdateFriendshipOptions, TwitterResponse<TwitterRelationship>> methodToCall = TwitterFriendship.Update;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ screenname,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterRelationship>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+ }
+
+ /// <summary>
+ /// Returns the numeric IDs for every user the specified user is does not want to see retweets from.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="screenname">The screenname.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Update(OAuthTokens tokens, string screenname, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterRelationship>> function)
+ {
+ Func<OAuthTokens, string, TwitterResponse<TwitterRelationship>> methodToCall = TwitterFriendship.Update;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ screenname,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterRelationship>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+ }
}
}
View
455 Twitterizer2.Async/TwitterTrendsAsync.cs
@@ -39,10 +39,19 @@ namespace Twitterizer
#endif
public static class TwitterTrendsAsync
{
- public static IAsyncResult Trends(int WoeID, TrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendCollection>> function)
+
+ /// <summary>
+ /// Gets the trends with the specified WOEID.
+ /// </summary>
+ /// <param name="WoeID">The WOEID.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Trends(int WoeID, LocalTrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendCollection>> function)
{
#if !SILVERLIGHT
- Func<int, TrendsOptions, TwitterResponse<TwitterTrendCollection>> methodToCall = TwitterTrend.Trends;
+ Func<int, LocalTrendsOptions, TwitterResponse<TwitterTrendCollection>> methodToCall = TwitterTrend.Trends;
return methodToCall.BeginInvoke(
WoeID,
@@ -68,5 +77,447 @@ public static IAsyncResult Trends(int WoeID, TrendsOptions options, TimeSpan tim
return null;
#endif
}
+
+ /// <summary>
+ /// Gets the trends with the specified WOEID.
+ /// </summary>
+ /// <param name="WoeID">The WOEID.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Trends(int WoeID, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendCollection>> function)
+ {
+#if !SILVERLIGHT
+ Func<int, TwitterResponse<TwitterTrendCollection>> methodToCall = TwitterTrend.Trends;
+
+ return methodToCall.BeginInvoke(
+ WoeID,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Trends(WoeID).ToAsyncResponse<TwitterTrendCollection>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the trends with the specified WOEID.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="WoeID">The WOEID.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Trends(OAuthTokens tokens, int WoeID, LocalTrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendCollection>> function)
+ {
+#if !SILVERLIGHT
+ Func<OAuthTokens, int, LocalTrendsOptions, TwitterResponse<TwitterTrendCollection>> methodToCall = TwitterTrend.Trends;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ WoeID,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Trends(tokens, WoeID, options).ToAsyncResponse<TwitterTrendCollection>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the trends with the specified WOEID.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="WoeID">The WOEID.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Trends(OAuthTokens tokens, int WoeID, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendCollection>> function)
+ {
+#if !SILVERLIGHT
+ Func<OAuthTokens, int, TwitterResponse<TwitterTrendCollection>> methodToCall = TwitterTrend.Trends;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ WoeID,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Trends(tokens, WoeID).ToAsyncResponse<TwitterTrendCollection>());
+ });
+ return null;
+#endif
+ }
+
+
+
+ /// <summary>
+ /// Gets the locations where trends are available.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Available(OAuthTokens tokens, AvailableTrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendLocationCollection>> function)
+ {
+#if !SILVERLIGHT
+ Func<OAuthTokens, AvailableTrendsOptions, TwitterResponse<TwitterTrendLocationCollection>> methodToCall = TwitterTrend.Available;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendLocationCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Available(tokens, options).ToAsyncResponse<TwitterTrendLocationCollection>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the locations where trends are available.
+ /// </summary>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Available(AvailableTrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendLocationCollection>> function)
+ {
+#if !SILVERLIGHT
+ Func<AvailableTrendsOptions, TwitterResponse<TwitterTrendLocationCollection>> methodToCall = TwitterTrend.Available;
+
+ return methodToCall.BeginInvoke(
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendLocationCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Available(options).ToAsyncResponse<TwitterTrendLocationCollection>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the locations where trends are available.
+ /// </summary>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Available(TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendLocationCollection>> function)
+ {
+#if !SILVERLIGHT
+ Func<TwitterResponse<TwitterTrendLocationCollection>> methodToCall = TwitterTrend.Available;
+
+ return methodToCall.BeginInvoke(
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendLocationCollection>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Available().ToAsyncResponse<TwitterTrendLocationCollection>());
+ });
+ return null;
+#endif
+ }
+
+
+ /// <summary>
+ /// Gets the daily global trends
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Daily(OAuthTokens tokens, TrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendDictionary>> function)
+ {
+#if !SILVERLIGHT
+ Func<OAuthTokens, TrendsOptions, TwitterResponse<TwitterTrendDictionary>> methodToCall = TwitterTrend.Daily;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendDictionary>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Daily(tokens, options).ToAsyncResponse<TwitterTrendDictionary>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the daily global trends
+ /// </summary>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Daily(TrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendDictionary>> function)
+ {
+#if !SILVERLIGHT
+ Func<TrendsOptions, TwitterResponse<TwitterTrendDictionary>> methodToCall = TwitterTrend.Daily;
+
+ return methodToCall.BeginInvoke(
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendDictionary>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Daily(options).ToAsyncResponse<TwitterTrendDictionary>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the daily global trends
+ /// </summary>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Daily(TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendDictionary>> function)
+ {
+#if !SILVERLIGHT
+ Func<TwitterResponse<TwitterTrendDictionary>> methodToCall = TwitterTrend.Daily;
+
+ return methodToCall.BeginInvoke(
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendDictionary>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Daily().ToAsyncResponse<TwitterTrendDictionary>());
+ });
+ return null;
+#endif
+ }
+
+
+ /// <summary>
+ /// Gets the weekly global trends
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Weekly(OAuthTokens tokens, TrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendDictionary>> function)
+ {
+#if !SILVERLIGHT
+ Func<OAuthTokens, TrendsOptions, TwitterResponse<TwitterTrendDictionary>> methodToCall = TwitterTrend.Weekly;
+
+ return methodToCall.BeginInvoke(
+ tokens,
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendDictionary>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Weekly(tokens, options).ToAsyncResponse<TwitterTrendDictionary>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the weekly global trends
+ /// </summary>
+ /// <param name="options">The options.</param>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Weekly(TrendsOptions options, TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendDictionary>> function)
+ {
+#if !SILVERLIGHT
+ Func<TrendsOptions, TwitterResponse<TwitterTrendDictionary>> methodToCall = TwitterTrend.Weekly;
+
+ return methodToCall.BeginInvoke(
+ options,
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendDictionary>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Weekly(options).ToAsyncResponse<TwitterTrendDictionary>());
+ });
+ return null;
+#endif
+ }
+
+ /// <summary>
+ /// Gets the weekly global trends
+ /// </summary>
+ /// <param name="timeout">The timeout.</param>
+ /// <param name="function">The function.</param>
+ /// <returns></returns>
+ public static IAsyncResult Weekly(TimeSpan timeout, Action<TwitterAsyncResponse<TwitterTrendDictionary>> function)
+ {
+#if !SILVERLIGHT
+ Func<TwitterResponse<TwitterTrendDictionary>> methodToCall = TwitterTrend.Weekly;
+
+ return methodToCall.BeginInvoke(
+ result =>
+ {
+ result.AsyncWaitHandle.WaitOne(timeout);
+ try
+ {
+ function(methodToCall.EndInvoke(result).ToAsyncResponse());
+ }
+ catch (Exception ex)
+ {
+ function(new TwitterAsyncResponse<TwitterTrendDictionary>() { Result = RequestResult.Unknown, ExceptionThrown = ex });
+ }
+ },
+ null);
+#else
+ ThreadPool.QueueUserWorkItem((x) =>
+ {
+ function(TwitterTrend.Weekly().ToAsyncResponse<TwitterTrendDictionary>());
+ });
+ return null;
+#endif
+ }
}
}
View
4 Twitterizer2.Async/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.0.3" />
+</packages>
View
37 Twitterizer2.Silverlight/Twitterizer2.Silverlight.csproj
@@ -112,6 +112,9 @@
<Compile Include="..\Twitterizer2\Core\TwitterCursorPagedIdCollection.cs">
<Link>TwitterCursorPagedIdCollection.cs</Link>
</Compile>
+ <Compile Include="..\Twitterizer2\Core\TwitterDictionary.cs">
+ <Link>TwitterDictionary.cs</Link>
+ </Compile>
<Compile Include="..\Twitterizer2\Core\TwitterIdCollection.cs">
<Link>TwitterIdCollection.cs</Link>
</Compile>
@@ -253,6 +256,9 @@
<Compile Include="..\Twitterizer2\Methods\Friendship\IncomingFriendshipsOptions.cs">
<Link>IncomingFriendshipsOptions.cs</Link>
</Compile>
+ <Compile Include="..\Twitterizer2\Methods\Friendship\NoRetweetIDsCommand.cs">
+ <Link>NoRetweetIDsCommand.cs</Link>
+ </Compile>
<Compile Include="..\Twitterizer2\Methods\Friendship\OutgoingFriendshipsCommand.cs">
<Link>OutgoingFriendshipsCommand.cs</Link>
</Compile>
@@ -268,6 +274,15 @@
<Compile Include="..\Twitterizer2\Methods\Friendship\TwitterRelationship.cs">
<Link>TwitterRelationship.cs</Link>
</Compile>
+ <Compile Include="..\Twitterizer2\Methods\Friendship\TwitterRelationshipUser.cs">
+ <Link>TwitterRelationshipUser.cs</Link>
+ </Compile>
+ <Compile Include="..\Twitterizer2\Methods\Friendship\UpdateFriendshipCommand.cs">
+ <Link>UpdateFriendshipCommand.cs</Link>
+ </Compile>
+ <Compile Include="..\Twitterizer2\Methods\Friendship\UpdateFriendshipOptions.cs">
+ <Link>UpdateFriendshipOptions.cs</Link>
+ </Compile>
<Compile Include="..\Twitterizer2\Methods\Friendship\UserIdCollection.cs">
<Link>UserIdCollection.cs</Link>
</Compile>
@@ -439,6 +454,18 @@
<Compile Include="..\Twitterizer2\Methods\Timeline\UserTimelineOptions.cs">
<Link>UserTimelineOptions.cs</Link>
</Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\AvailableTrendsCommand.cs">
+ <Link>AvailableTrendsCommand.cs</Link>
+ </Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\AvailableTrendsOptions.cs">
+ <Link>AvailableTrendsOptions.cs</Link>
+ </Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\DailyTrendsCommand.cs">
+ <Link>DailyTrendsCommand.cs</Link>
+ </Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\LocalTrendsOptions.cs">
+ <Link>LocalTrendsOptions.cs</Link>
+ </Compile>
<Compile Include="..\Twitterizer2\Methods\Trends\TrendsCommand.cs">
<Link>TrendsCommand.cs</Link>
</Compile>
@@ -451,12 +478,21 @@
<Compile Include="..\Twitterizer2\Methods\Trends\TwitterTrendCollection.cs">
<Link>TwitterTrendCollection.cs</Link>
</Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\TwitterTrendDictionary.cs">
+ <Link>TwitterTrendDictionary.cs</Link>
+ </Compile>
<Compile Include="..\Twitterizer2\Methods\Trends\TwitterTrendLocation.cs">
<Link>TwitterTrendLocation.cs</Link>
</Compile>
<Compile Include="..\Twitterizer2\Methods\Trends\TwitterTrendLocationCollection.cs">
<Link>TwitterTrendLocationCollection.cs</Link>
</Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\TwitterTrendLocationPlaceType.cs">
+ <Link>TwitterTrendLocationPlaceType.cs</Link>
+ </Compile>
+ <Compile Include="..\Twitterizer2\Methods\Trends\WeeklyTrendsCommand.cs">
+ <Link>WeeklyTrendsCommand.cs</Link>
+ </Compile>
<Compile Include="..\Twitterizer2\Methods\Tweets\DeleteStatusCommand.cs">
<Link>DeleteStatusCommand.cs</Link>
</Compile>
@@ -601,6 +637,7 @@
<None Include="..\Twitterizer2\Twitterizer2.snk">
<Link>Twitterizer2.snk</Link>
</None>
+ <None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<ProjectExtensions>
View
4 Twitterizer2.Silverlight/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.0.3" />
+</packages>
View
3 Twitterizer2.Streaming.Silverlight/Twitterizer2.Streaming.Silverlight.csproj
@@ -95,6 +95,9 @@
<Name>Twitterizer2.Silverlight</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
View
4 Twitterizer2.Streaming.Silverlight/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="4.0.3" />
+</packages>
View
2 Twitterizer2.TestCases/TwitterFriendshipTests.cs
@@ -22,7 +22,7 @@ public static void ShowCreateAndDelete()
TwitterRelationship friendship = TwitterFriendship.Show(tokens, "rickydev").ResponseObject;
// If it exists, delete it.
- if (friendship.Target.IsFollowing != null && friendship.Target.IsFollowing.Value)
+ if (friendship.Target.Following != null && friendship.Target.Following)
{
DeleteFriendship(tokens, friendship);
}
View
8 Twitterizer2.TestCases/Twitterizer2.TestCases.csproj
@@ -65,15 +65,9 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.4.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+ <Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
</Reference>
- <Reference Include="nunit.mocks, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <HintPath>..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
- </Reference>
- <Reference Include="pnunit.framework, Version=1.0.4109.34242, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core">
View
61 Twitterizer2/Core/TwitterDictionary.cs
@@ -0,0 +1,61 @@
+//-----------------------------------------------------------------------
+// <copyright file="TwitterDictionary.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The base class for object dictionaries.</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer.Core
+{
+ using System;
+ using System.Collections.ObjectModel;
+ using System.Runtime.Serialization;
+ using System.Collections.Generic;
+
+ /// <summary>
+ /// The base class for object dictionaries.
+ /// </summary>
+ /// <typeparam name="T">The type of object stored in the collection.</typeparam>
+#if !SILVERLIGHT
+ [Serializable]
+#endif
+ [DataContract]
+ public abstract class TwitterDictionary<T, T2> : Dictionary<T, T2>
+ //where T : class, ITwitterObject
+ where T2: class, ITwitterObject
+ {
+ /// <summary>
+ /// Gets or sets the annotations.
+ /// </summary>
+ /// <value>The annotations.</value>
+ [DataMember]
+ public System.Collections.Generic.Dictionary<string, string> Annotations { get; set; }
+ }
+}
View
5 Twitterizer2/Methods/Favorites/ListFavoritesCommand.cs
@@ -74,7 +74,7 @@ public override void Init()
this.RequestParameters.Add("page", "1");
return;
}
-
+
this.RequestParameters.Add("page", options.Page > 0 ? options.Page.ToString(CultureInfo.InvariantCulture) : "1");
if (!string.IsNullOrEmpty(options.UserNameOrId))
@@ -86,6 +86,9 @@ public override void Init()
{
this.RequestParameters.Add("count", options.Count.ToString(CultureInfo.InvariantCulture));
}
+
+ if (options.SinceStatusId > 0)
+ this.RequestParameters.Add("since_id", options.SinceStatusId.ToString());
}
}
}
View
6 Twitterizer2/Methods/Favorites/ListFavoritesOptions.cs
@@ -59,5 +59,11 @@ public class ListFavoritesOptions : OptionalProperties
/// </summary>
/// <value>The page number.</value>
public int Page { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minimum (earliest) status id to request.
+ /// </summary>
+ /// <value>The since id.</value>
+ public decimal SinceStatusId { get; set; }
}
}
View
60 Twitterizer2/Methods/Friendship/NoRetweetIDsCommand.cs
@@ -0,0 +1,60 @@
+//-----------------------------------------------------------------------
+// <copyright file="NoRetweetIDsCommand.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The outgoing friendship command class</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer.Commands
+{
+ using System.Globalization;
+ using Twitterizer.Core;
+
+ /// <summary>
+ /// Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
+ /// </summary>
+ internal sealed class NoRetweetIDsCommand : TwitterCommand<UserIdCollection>
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="IncomingFriendshipsCommand"/> class.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="options">The options.</param>
+ public NoRetweetIDsCommand(OAuthTokens tokens, OptionalProperties options)
+ : base(HTTPVerb.GET, "friendships/no_retweet_ids.json", tokens, options)
+ { }
+
+ /// <summary>
+ /// Inits this instance.
+ /// </summary>
+ public override void Init()
+ { }
+ }
+}
View
70 Twitterizer2/Methods/Friendship/TwitterFriendship.cs
@@ -485,5 +485,75 @@ public static TwitterResponse<TwitterCursorPagedIdCollection> OutgoingRequests(O
return OutgoingRequests(tokens, null);
}
+ /// <summary>
+ /// Returns a collection of IDs that the user does not want to see retweets from.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="options">The options.</param>
+ /// <returns></returns>
+ public static TwitterResponse<UserIdCollection> NoRetweetIDs(OAuthTokens tokens, OptionalProperties options)
+ {
+ Commands.NoRetweetIDsCommand command = new Commands.NoRetweetIDsCommand(tokens, options);
+ return Core.CommandPerformer.PerformAction(command);
+ }
+
+ /// <summary>
+ /// Returns a collection of IDs that the user does not want to see retweets from.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <returns></returns>
+ public static TwitterResponse<UserIdCollection> NoRetweetIDs(OAuthTokens tokens)
+ {
+ return NoRetweetIDs(tokens, null);
+ }
+
+ /// <summary>
+ /// Updates a friendship for a user.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="userid">The userid.</param>
+ /// <param name="options">The options.</param>
+ /// <returns></returns>
+ public static TwitterResponse<TwitterRelationship> Update(OAuthTokens tokens, decimal userid, UpdateFriendshipOptions options)
+ {
+ Commands.UpdateFriendshipCommand command = new Commands.UpdateFriendshipCommand(tokens, userid, options);
+ return Core.CommandPerformer.PerformAction(command);
+ }
+
+ /// <summary>
+ /// Updates a friendship for a user.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="userid">The userid.</param>
+ /// <returns></returns>
+ public static TwitterResponse<TwitterRelationship> Update(OAuthTokens tokens, decimal userid)
+ {
+ return Update(tokens, userid, null);
+ }
+
+ /// <summary>
+ /// Updates a friendship for a user.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="screenname">The screenname.</param>
+ /// <param name="options">The options.</param>
+ /// <returns></returns>
+ public static TwitterResponse<TwitterRelationship> Update(OAuthTokens tokens, string screenname, UpdateFriendshipOptions options)
+ {
+ Commands.UpdateFriendshipCommand command = new Commands.UpdateFriendshipCommand(tokens, screenname, options);
+ return Core.CommandPerformer.PerformAction(command);
+ }
+
+ /// <summary>
+ /// Updates a friendship for a user.
+ /// </summary>
+ /// <param name="tokens">The tokens.</param>
+ /// <param name="screenname">The screenname.</param>
+ /// <returns></returns>
+ public static TwitterResponse<TwitterRelationship> Update(OAuthTokens tokens, string screenname)
+ {
+ return Update(tokens, screenname, null);
+ }
+
}
}
View
8 Twitterizer2/Methods/Friendship/TwitterRelationship.cs
@@ -52,19 +52,19 @@ public class TwitterRelationship : TwitterObject
/// <summary>
/// The relationship source
/// </summary>
- private TwitterUser source;
+ private TwitterRelationshipUser source;
/// <summary>
/// The relationship target
/// </summary>
- private TwitterUser target;
+ private TwitterRelationshipUser target;
/// <summary>
/// Gets or sets the source.
/// </summary>
/// <value>The source.</value>
[JsonProperty(PropertyName = "source")]
- public TwitterUser Source
+ public TwitterRelationshipUser Source
{
get
{
@@ -82,7 +82,7 @@ public TwitterUser Source
/// </summary>
/// <value>The target.</value>
[JsonProperty(PropertyName = "target")]
- public TwitterUser Target
+ public TwitterRelationshipUser Target
{
get
{
View
123 Twitterizer2/Methods/Friendship/TwitterRelationshipUser.cs
@@ -0,0 +1,123 @@
+//-----------------------------------------------------------------------
+// <copyright file="TwitterRelationshipUser.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>David Golden</author>
+// <summary>The twitter relationship user class</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer
+{
+ using System;
+ using System.Diagnostics;
+ using Newtonsoft.Json;
+ using Twitterizer.Core;
+
+ /// <summary>
+ /// The Twitter Relationship entity class
+ /// </summary>
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+#if !SILVERLIGHT
+ [Serializable]
+#endif
+ public class TwitterRelationshipUser : TwitterObject
+ {
+
+ /// <summary>
+ /// Gets or sets the ID.
+ /// </summary>
+ /// <value>The ID.</value>
+ [JsonProperty(PropertyName = "id")]
+ public decimal Id { get; set; }
+
+ /// <summary>
+ /// Gets or sets if Following.
+ /// </summary>
+ /// <value>Is the user following.</value>
+ [JsonProperty(PropertyName = "following")]
+ public bool Following { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ScreenName.
+ /// </summary>
+ /// <value>The users ScreenName.</value>
+ [JsonProperty(PropertyName = "screen_name")]
+ public string ScreenName { get; set; }
+
+ /// <summary>
+ /// Gets or sets if followed by.
+ /// </summary>
+ /// <value>Is the user being followed by.</value>
+ [JsonProperty(PropertyName = "followed_by")]
+ public bool FollowedBy { get; set; }
+
+ /// <summary>
+ /// Gets or sets if notifications are enabled.
+ /// </summary>
+ /// <value>Notifications enabled for this user.</value>
+ [JsonProperty(PropertyName = "notifications_enabled")]
+ public bool? NotificationsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets if Can DM.
+ /// </summary>
+ /// <value>Can the user be DM.</value>
+ [JsonProperty(PropertyName = "can_dm")]
+ public bool CanDM { get; set; }
+
+ /// <summary>
+ /// Gets or sets if wants retweets.
+ /// </summary>
+ /// <value>The user wants to see retweets.</value>
+ [JsonProperty(PropertyName = "want_retweets")]
+ public bool? WantRetweets { get; set; }
+
+ /// <summary>
+ /// Gets or sets if marked as spam.
+ /// </summary>
+ /// <value>If the user is marked as spam.</value>
+ [JsonProperty(PropertyName = "marked_spam")]
+ public bool? MarkedSpam { get; set; }
+
+ /// <summary>
+ /// Gets or sets if all replies.
+ /// </summary>
+ /// <value>If the user wants All Replies.</value>
+ [JsonProperty(PropertyName = "all_replies")]
+ public bool? AllReplies { get; set; }
+
+ /// <summary>
+ /// Gets or sets if blocking.
+ /// </summary>
+ /// <value>If the user is blocked.</value>
+ [JsonProperty(PropertyName = "blocking")]
+ public bool? Blocking { get; set; }
+
+ }
+}
View
137 Twitterizer2/Methods/Friendship/UpdateFriendshipCommand.cs
@@ -0,0 +1,137 @@
+//-----------------------------------------------------------------------
+// <copyright file="UpdateFriendshipCommand.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The Direct Messages Sent Command class.</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer.Commands
+{
+ using System;
+ using System.Globalization;
+ using Twitterizer;
+ using Twitterizer.Core;
+
+ /// <summary>
+ /// Creates a friendship between the authenticated user and another user
+ /// </summary>
+ [AuthorizedCommandAttribute]
+#if !SILVERLIGHT
+ [Serializable]
+#endif
+ internal sealed class UpdateFriendshipCommand : Core.TwitterCommand<TwitterRelationship>
+ {
+ /// <summary>
+ /// The base address to the API method.
+ /// </summary>
+ private const string Path = "friendships/update.json";
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="UpdateFriendshipCommand"/> class.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="userId">The userid.</param>
+ /// <param name="optionalProperties">The optional properties.</param>
+ public UpdateFriendshipCommand(OAuthTokens tokens, decimal userId, UpdateFriendshipOptions optionalProperties)
+ : base(HTTPVerb.POST, Path, tokens, optionalProperties)
+ {
+ if (tokens == null)
+ {
+ throw new ArgumentNullException("tokens");
+ }
+
+ if (userId <= 0)
+ {
+ throw new ArgumentException("userId");
+ }
+
+ this.UserId = userId;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="UpdateFriendshipCommand"/> class.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="userName">Name of the user.</param>
+ /// <param name="optionalProperties">The optional properties.</param>
+ public UpdateFriendshipCommand(OAuthTokens tokens, string userName, UpdateFriendshipOptions optionalProperties)
+ : base(HTTPVerb.POST, Path, tokens, optionalProperties)
+ {
+ if (tokens == null)
+ {
+ throw new ArgumentNullException("tokens");
+ }
+
+ if (string.IsNullOrEmpty(userName))
+ {
+ throw new ArgumentNullException("userName");
+ }
+
+ this.UserName = userName;
+ }
+
+ /// <summary>
+ /// Gets or sets the user id.
+ /// </summary>
+ /// <value>The user id.</value>
+ public decimal UserId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the username.
+ /// </summary>
+ /// <value>The username.</value>
+ public string UserName { get; set; }
+
+ /// <summary>
+ /// Initializes the command.
+ /// </summary>
+ public override void Init()
+ {
+ if (this.UserId > 0)
+ {
+ this.RequestParameters.Add("user_id", this.UserId.ToString(CultureInfo.InvariantCulture));
+ }
+ else if (!string.IsNullOrEmpty(this.UserName))
+ {
+ this.RequestParameters.Add("screen_name", this.UserName);
+ }
+
+ UpdateFriendshipOptions options = this.OptionalProperties as UpdateFriendshipOptions;
+ if (options != null)
+ {
+ if (options.DeviceNotifications != null)
+ this.RequestParameters.Add("device", (bool)options.DeviceNotifications ? "true" : "false");
+
+ if (options.ShowRetweets != null)
+ this.RequestParameters.Add("retweets", (bool)options.ShowRetweets ? "true" : "false");
+ }
+ }
+ }
+}
View
68 Twitterizer2/Methods/Friendship/UpdateFriendshipOptions.cs
@@ -0,0 +1,68 @@
+//-----------------------------------------------------------------------
+// <copyright file="UpdateFriendshipOptions.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>David Golden</author>
+// <summary>The update friendship options class.</summary>
+//-----------------------------------------------------------------------
+namespace Twitterizer
+{
+ using System;
+
+ /// <summary>
+ /// The Update Friendship Options class
+ /// </summary>
+#if !SILVERLIGHT
+ [System.Serializable]
+#endif
+ public sealed class UpdateFriendshipOptions : OptionalProperties
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="UpdateFriendshipOptions"/> class.
+ /// </summary>
+ public UpdateFriendshipOptions()
+ : base()
+ {
+ DeviceNotifications = null;
+ ShowRetweets = null;
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to enable delivery of statuses from this user to the authenticated user's device
+ /// </summary>
+ /// <value><c>true</c> if follow; otherwise, <c>false</c>.</value>
+ public bool? DeviceNotifications { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show retweets for this user
+ /// </summary>
+ /// <value><c>true</c> if follow; otherwise, <c>false</c>.</value>
+ public bool? ShowRetweets { get; set; }
+ }
+}
View
7 Twitterizer2/Methods/Search/TwitterSearchResult.cs
@@ -132,6 +132,13 @@ public class TwitterSearchResult : Core.TwitterObject
public string Location { get; set; }
/// <summary>
+ /// Gets or sets the status id the status is in reply to.
+ /// </summary>
+ /// <value>The status id.</value>
+ [DataMember, JsonProperty(PropertyName = "in_reply_to_status_id")]
+ public decimal? InReplyToStatusId { get; set; }
+
+ /// <summary>
/// Gets or sets the entities.
/// </summary>
/// <value>The entities.</value>
View
82 Twitterizer2/Methods/Trends/AvailableTrendsCommand.cs
@@ -0,0 +1,82 @@
+//-----------------------------------------------------------------------
+// <copyright file="AvailableTrendsCommand.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The available trends command class</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer.Commands
+{
+ using System;
+ using Twitterizer;
+ using Twitterizer.Core;
+ using System.Globalization;
+
+ /// <summary>
+ /// The create list command class
+ /// </summary>
+#if !SILVERLIGHT
+ [Serializable]
+#endif
+ internal sealed class AvailableTrendsCommand : TwitterCommand<TwitterTrendLocationCollection>
+ {
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AvailableTrendsCommand"/> class.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ public AvailableTrendsCommand(OAuthTokens tokens, AvailableTrendsOptions options)
+ : base(
+ HTTPVerb.GET,
+ "trends/available.json",
+ tokens,
+ options)
+ {
+ }
+ #endregion
+
+
+ public override void Init()
+ {
+ AvailableTrendsOptions options = this.OptionalProperties as AvailableTrendsOptions;
+ if (options == null)
+ {
+ return;
+ }
+
+ if (options.Lat != null)
+ this.RequestParameters.Add("lat", options.Lat.ToString());
+
+ if (options.Long != null)
+ this.RequestParameters.Add("long", options.Long.ToString());
+ }
+ }
+}
View
56 Twitterizer2/Methods/Trends/AvailableTrendsOptions.cs
@@ -0,0 +1,56 @@
+//-----------------------------------------------------------------------
+// <copyright file="AvailableTrendsOptions.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The available trends options class.</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer
+{
+ /// <summary>
+ /// The available trends options class. Provides a payload for optional parameters for the AvailableTrendsCommand class.
+ /// </summary>
+#if !SILVERLIGHT
+ [System.Serializable]
+#endif
+ public class AvailableTrendsOptions : OptionalProperties
+ {
+ /// <summary>
+ /// Gets or sets a value indicating how to order the list nearest to furthest.
+ /// </summary>
+ public double? Lat { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating how to order the list nearest to furthest.
+ /// </summary>
+ public double? Long { get; set; }
+
+ }
+}
View
86 Twitterizer2/Methods/Trends/DailyTrendsCommand.cs
@@ -0,0 +1,86 @@
+//-----------------------------------------------------------------------
+// <copyright file="DailyTrendsCommand.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The trends command class</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer.Commands
+{
+ using System;
+ using Twitterizer;
+ using Twitterizer.Core;
+ using System.Globalization;
+
+ /// <summary>
+ /// The create list command class
+ /// </summary>
+#if !SILVERLIGHT
+ [Serializable]
+#endif
+ internal sealed class DailyTrendsCommand : TwitterCommand<TwitterTrendDictionary>
+ {
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TrendsCommand"/> class.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ public DailyTrendsCommand(OAuthTokens tokens, TrendsOptions options)
+ : base(
+ HTTPVerb.GET,
+ "trends/daily.json",
+ tokens,
+ options)
+ {
+ }
+ #endregion
+
+ /// <summary>
+ /// Initializes the command.
+ /// </summary>
+ public override void Init()
+ {
+ TrendsOptions options = this.OptionalProperties as TrendsOptions;
+ if (options == null)
+ {
+ return;
+ }
+
+ if (!String.IsNullOrEmpty(options.Date))
+ this.RequestParameters.Add("date", options.Date);
+
+ if (options.ExcludeHashTags)
+ {
+ this.RequestParameters.Add("exclude", "hashtags");
+ }
+ }
+ }
+}
View
51 Twitterizer2/Methods/Trends/LocalTrendsOptions.cs
@@ -0,0 +1,51 @@
+//-----------------------------------------------------------------------
+// <copyright file="LocalTrendsOptions.cs" company="Patrick 'Ricky' Smith">
+// This file is part of the Twitterizer library (http://www.twitterizer.net/)
+//
+// Copyright (c) 2010, Patrick "Ricky" Smith (ricky@digitally-born.com)
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// - Redistributions of source code must retain the above copyright notice, this list
+// of conditions and the following disclaimer.
+// - Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+// - Neither the name of the Twitterizer nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+// </copyright>
+// <author>Ricky Smith</author>
+// <summary>The trends options class.</summary>
+//-----------------------------------------------------------------------
+
+namespace Twitterizer
+{
+ /// <summary>
+ /// The trends options class. Provides a payload for optional parameters for the TrendsCommand class.
+ /// </summary>
+#if !SILVERLIGHT
+ [System.Serializable]
+#endif
+ public class LocalTrendsOptions : OptionalProperties
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether [exclude hash tags].
+ /// </summary>
+ /// <value><c>true</c> if [exclude hash tags]; otherwise, <c>false</c>.</value>
+ public bool ExcludeHashTags { get; set; }
+ }
+}
View
11 Twitterizer2/Methods/Trends/TrendsCommand.cs
@@ -51,13 +51,14 @@ internal sealed class TrendsCommand : TwitterCommand<TwitterTrendCollection>
/// <summary>
/// Initializes a new instance of the <see cref="TrendsCommand"/> class.
/// </summary>
- /// <param name="options">The WOEID.</param>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="WOEID">The WOEID.</param>
/// <param name="options">The options.</param>
- public TrendsCommand(int WOEID, TrendsOptions options)
+ public TrendsCommand(OAuthTokens tokens, int WOEID, LocalTrendsOptions options)
: base(
HTTPVerb.GET,
- string.Format(CultureInfo.InvariantCulture, "trends/{0}.json", WOEID),
- null,
+ string.Format(CultureInfo.InvariantCulture, "trends/{0}.json", WOEID),
+ tokens,
options)
{
}
@@ -68,7 +69,7 @@ public TrendsCommand(int WOEID, TrendsOptions options)
/// </summary>
public override void Init()
{
- TrendsOptions options = this.OptionalProperties as TrendsOptions;
+ LocalTrendsOptions options = this.OptionalProperties as LocalTrendsOptions;
if (options == null)
{
return;
View
11 Twitterizer2/Methods/Trends/TrendsOptions.cs
@@ -29,23 +29,22 @@
// POSSIBILITY OF SUCH DAMAGE.
// </copyright>
// <author>Ricky Smith</author>
-// <summary>The trends options class.</summary>
+// <summary>The daily trends options class.</summary>
//-----------------------------------------------------------------------
namespace Twitterizer
{
/// <summary>
- /// The current trends options class. Provides a payload for optional parameters for the CurrentTrendsCommand class.
+ /// The trends options class. Provides a payload for optional parameters for the TrendsCommand class.
/// </summary>
#if !SILVERLIGHT
[System.Serializable]
#endif
- public class TrendsOptions : OptionalProperties
+ public class TrendsOptions : LocalTrendsOptions
{
/// <summary>
- /// Gets or sets a value indicating whether [exclude hash tags].
+ /// Gets or sets a value indicating whether to set the start date of the returned trends (Format "yyyy-MM-dd")
/// </summary>
- /// <value><c>true</c> if [exclude hash tags]; otherwise, <c>false</c>.</value>
- public bool ExcludeHashTags { get; set; }
+ public string Date { get; set; }
}
}
View
134 Twitterizer2/Methods/Trends/TwitterTrend.cs
@@ -85,28 +85,152 @@ public class TwitterTrend : TwitterObject
/// <summary>
/// Gets the trends with the specified WOEID.
/// </summary>
- /// <param name="options">The WOEID.</param>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="WoeID">The WOEID.</param>
/// <param name="options">The options.</param>
/// <returns>
/// A collection of <see cref="Twitterizer.TwitterTrend"/> objects.
/// </returns>
- public static TwitterResponse<TwitterTrendCollection> Trends(int WoeID, TrendsOptions options)
+ public static TwitterResponse<TwitterTrendCollection> Trends(OAuthTokens tokens, int WoeID, LocalTrendsOptions options)
{
- Commands.TrendsCommand command = new Twitterizer.Commands.TrendsCommand(WoeID, options);
+ Commands.TrendsCommand command = new Twitterizer.Commands.TrendsCommand(tokens, WoeID, options);
return Core.CommandPerformer.PerformAction(command);
}
/// <summary>
/// Gets the current trends.
/// </summary>
- /// <param name="options">The WOEID.</param>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="WoeID">The WOEID.</param>
+ /// <returns>
+ /// A collection of <see cref="Twitterizer.TwitterTrend"/> objects.
+ /// </returns>
+ public static TwitterResponse<TwitterTrendCollection> Trends(OAuthTokens tokens, int WoeID)
+ {
+ return Trends(tokens, WoeID, null);
+ }
+
+ /// <summary>
+ /// Gets the trends with the specified WOEID.
+ /// </summary>
+ /// <param name="WoeID">The WOEID.</param>
+ /// <param name="options">The options.</param>
+ /// <returns>
+ /// A collection of <see cref="Twitterizer.TwitterTrend"/> objects.
+ /// </returns>
+ public static TwitterResponse<TwitterTrendCollection> Trends(int WoeID, LocalTrendsOptions options)
+ {
+ return Trends(null, WoeID, options);
+ }
+
+ /// <summary>
+ /// Gets the current trends.
+ /// </summary>
+ /// <param name="WoeID">The WOEID.</param>
/// <returns>
/// A collection of <see cref="Twitterizer.TwitterTrend"/> objects.
/// </returns>
public static TwitterResponse<TwitterTrendCollection> Trends(int WoeID)
{
- return Trends(WoeID, null);
+ return Trends(null, WoeID, null);
+ }
+
+ /// <summary>
+ /// Gets the locations where trends are available.
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ /// <returns>
+ /// A collection of <see cref="Twitterizer.TwitterTrendLocation"/> objects.
+ /// </returns>
+ public static TwitterResponse<TwitterTrendLocationCollection> Available(OAuthTokens tokens, AvailableTrendsOptions options)
+ {
+ Commands.AvailableTrendsCommand command = new Twitterizer.Commands.AvailableTrendsCommand(tokens, options);
+
+ return Core.CommandPerformer.PerformAction(command);
+ }
+
+ /// <summary>
+ /// Gets the locations where trends are available.
+ /// </summary>
+ /// <param name="options">The options.</param>
+ /// <returns>
+ /// A collection of <see cref="Twitterizer.TwitterTrendLocation"/> objects.
+ /// </returns>
+ public static TwitterResponse<TwitterTrendLocationCollection> Available(AvailableTrendsOptions options)
+ {
+ return Available(null, options);
+ }
+
+ /// <summary>
+ /// Gets the locations where trends are available.
+ /// </summary>
+ /// <returns>
+ /// A collection of <see cref="Twitterizer.TwitterTrendLocation"/> objects.
+ /// </returns>
+ public static TwitterResponse<TwitterTrendLocationCollection> Available()
+ {
+ return Available(null, null);
+ }
+
+
+ /// <summary>
+ /// Gets the daily global trends
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ public static TwitterResponse<TwitterTrendDictionary> Daily(OAuthTokens tokens, TrendsOptions options)
+ {
+ Commands.DailyTrendsCommand command = new Twitterizer.Commands.DailyTrendsCommand(tokens, options);
+
+ return Core.CommandPerformer.PerformAction(command);
+ }
+
+ /// <summary>
+ /// Gets the daily global trends
+ /// </summary>
+ /// <param name="options">The options.</param>
+ public static TwitterResponse<TwitterTrendDictionary> Daily(TrendsOptions options)
+ {
+ return Daily(null, options);
+ }
+
+ /// <summary>
+ /// Gets the daily global trends
+ /// </summary>
+ public static TwitterResponse<TwitterTrendDictionary> Daily()
+ {
+ return Daily(null, null);
+ }
+
+ /// <summary>
+ /// Gets the weekly global trends
+ /// </summary>
+ /// <param name="tokens">The request tokens.</param>
+ /// <param name="options">The options.</param>
+ public static TwitterResponse<TwitterTrendDictionary> Weekly(OAuthTokens tokens, TrendsOptions options)
+ {
+ Commands.WeeklyTrendsCommand command = new Twitterizer.Commands.WeeklyTrendsCommand(tokens, options);
+
+ return Core.CommandPerformer.PerformAction(command);
+ }
+
+ /// <summary>
+ /// Gets the weekly global trends
+ /// </summary>
+ /// <param name="options">The options.</param>
+ public static TwitterResponse<TwitterTrendDictionary> Weekly(TrendsOptions options)
+ {
+ return Weekly(null, options);
+ }
+
+ /// <summary>
+ /// Gets the weekly global trends
+ /// </summary>
+ public static TwitterResponse<TwitterTrendDictionary> Weekly()
+ {
+ return Weekly(null, null);
}