Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 197973e

Browse files
committedJul 4, 2013
Changed to support client side web and created Umbraco package for quick setup.
1 parent a5204d9 commit 197973e

29 files changed

+602
-86
lines changed
 

‎DLLs/Newtonsoft.Json.dll

-419 KB
Binary file not shown.

‎Example/Example.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
<Compile Include="Properties\AssemblyInfo.cs" />
4949
</ItemGroup>
5050
<ItemGroup>
51-
<ProjectReference Include="..\TwitterAPI\TwitterAPI.csproj">
52-
<Project>{13C25403-26C4-498B-A2A5-1F62DF34E105}</Project>
53-
<Name>TwitterAPI</Name>
54-
</ProjectReference>
51+
<None Include="app.config" />
5552
</ItemGroup>
5653
<ItemGroup>
57-
<None Include="app.config" />
54+
<ProjectReference Include="..\Twitter.Api\Twitter.Api.csproj">
55+
<Project>{13C25403-26C4-498B-A2A5-1F62DF34E105}</Project>
56+
<Name>Twitter.Api</Name>
57+
</ProjectReference>
5858
</ItemGroup>
5959
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6060
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

‎Example/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class Program
2121
static void Main(string[] args)
2222
{
2323
// Pass in all the OAuth keys to the constructor
24-
var twitter = new TwitterAPI.Tweet("[YourConsumerKey]",
25-
"[YourConsumerSecret]",
26-
"[YourAccessToken]",
27-
"[YourAccessTokenSecret]");
24+
var twitter = new Twitter.Api.Tweet("[YourConsumerKey]",
25+
"[YourConsumerSecret]",
26+
"[YourAccessToken]",
27+
"[YourAccessTokenSecret]");
2828

2929
// API url for a list
3030
// https://api.twitter.com/1.1/lists/statuses.json?slug=[LISTNAME]&owner_screen_name=[ACCOUNTNAME]&count=[COUNT]

‎Example/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,15 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
85
[assembly: AssemblyTitle("Example")]
96
[assembly: AssemblyDescription("")]
107
[assembly: AssemblyConfiguration("")]
118
[assembly: AssemblyCompany("")]
129
[assembly: AssemblyProduct("Example")]
13-
[assembly: AssemblyCopyright("Copyright © 2013")]
10+
[assembly: AssemblyCopyright("Copyright © 2013 uApe Ecommerce Limited")]
1411
[assembly: AssemblyTrademark("")]
1512
[assembly: AssemblyCulture("")]
16-
17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2013
[assembly: ComVisible(false)]
21-
22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
2314
[assembly: Guid("371c040d-d026-4aac-be1c-5b70290127f4")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
3515
[assembly: AssemblyVersion("1.0.0.0")]
3616
[assembly: AssemblyFileVersion("1.0.0.0")]

‎ExampleWeb/ExampleWeb.csproj

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>
7+
</ProductVersion>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}</ProjectGuid>
10+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
11+
<OutputType>Library</OutputType>
12+
<AppDesignerFolder>Properties</AppDesignerFolder>
13+
<RootNamespace>ExampleWeb</RootNamespace>
14+
<AssemblyName>ExampleWeb</AssemblyName>
15+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
16+
<UseIISExpress>false</UseIISExpress>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Microsoft.CSharp" />
37+
<Reference Include="System.Web.DynamicData" />
38+
<Reference Include="System.Web.Entity" />
39+
<Reference Include="System.Web.ApplicationServices" />
40+
<Reference Include="System" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="System.Web.Extensions" />
45+
<Reference Include="System.Xml.Linq" />
46+
<Reference Include="System.Drawing" />
47+
<Reference Include="System.Web" />
48+
<Reference Include="System.Xml" />
49+
<Reference Include="System.Configuration" />
50+
<Reference Include="System.Web.Services" />
51+
<Reference Include="System.EnterpriseServices" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<Content Include="index.htm" />
55+
<Content Include="js\twitter.api.combined.js">
56+
<DependentUpon>twitter.api.js</DependentUpon>
57+
</Content>
58+
<Content Include="js\twitter.api.js">
59+
<Compile>True</Compile>
60+
<Minify>True</Minify>
61+
</Content>
62+
<Content Include="js\twitter.api.min.js">
63+
<DependentUpon>twitter.api.js</DependentUpon>
64+
</Content>
65+
<Content Include="Timeline.asmx" />
66+
<Content Include="Web.config" />
67+
<Content Include="Web.Debug.config">
68+
<DependentUpon>Web.config</DependentUpon>
69+
</Content>
70+
<Content Include="Web.Release.config">
71+
<DependentUpon>Web.config</DependentUpon>
72+
</Content>
73+
</ItemGroup>
74+
<ItemGroup>
75+
<Compile Include="Properties\AssemblyInfo.cs" />
76+
</ItemGroup>
77+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
78+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
79+
<ProjectExtensions>
80+
<VisualStudio>
81+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
82+
<WebProjectProperties>
83+
<UseIIS>False</UseIIS>
84+
<AutoAssignPort>True</AutoAssignPort>
85+
<DevelopmentServerPort>45315</DevelopmentServerPort>
86+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
87+
<IISUrl>
88+
</IISUrl>
89+
<NTLMAuthentication>False</NTLMAuthentication>
90+
<UseCustomServer>False</UseCustomServer>
91+
<CustomServerUrl>
92+
</CustomServerUrl>
93+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
94+
</WebProjectProperties>
95+
</FlavorProperties>
96+
</VisualStudio>
97+
</ProjectExtensions>
98+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
99+
Other similar extension points exist, see Microsoft.Common.targets.
100+
<Target Name="BeforeBuild">
101+
</Target>
102+
<Target Name="AfterBuild">
103+
</Target>
104+
-->
105+
</Project>

‎ExampleWeb/Properties/AssemblyInfo.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("ExampleWeb")]
6+
[assembly: AssemblyDescription("")]
7+
[assembly: AssemblyConfiguration("")]
8+
[assembly: AssemblyCompany("")]
9+
[assembly: AssemblyProduct("ExampleWeb")]
10+
[assembly: AssemblyCopyright("Copyright © 2013 uApe Ecommerce Limited")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
[assembly: ComVisible(false)]
14+
[assembly: Guid("196fc689-d79c-4a52-9b8a-d3aeaae07623")]
15+
[assembly: AssemblyVersion("1.0.0.0")]
16+
[assembly: AssemblyFileVersion("1.0.0.0")]

‎ExampleWeb/Timeline.asmx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ WebService Language="C#" CodeBehind="Timeline.asmx.cs" Class="Twitter.Ajax.Timeline" %>

‎ExampleWeb/Web.Debug.config

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0"?>
2+
3+
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
4+
5+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
6+
<!--
7+
In the example below, the "SetAttributes" transform will change the value of
8+
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
9+
finds an atrribute "name" that has a value of "MyDB".
10+
11+
<connectionStrings>
12+
<add name="MyDB"
13+
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
14+
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
15+
</connectionStrings>
16+
-->
17+
<system.web>
18+
<!--
19+
In the example below, the "Replace" transform will replace the entire
20+
<customErrors> section of your web.config file.
21+
Note that because there is only one customErrors section under the
22+
<system.web> node, there is no need to use the "xdt:Locator" attribute.
23+
24+
<customErrors defaultRedirect="GenericError.htm"
25+
mode="RemoteOnly" xdt:Transform="Replace">
26+
<error statusCode="500" redirect="InternalError.htm"/>
27+
</customErrors>
28+
-->
29+
</system.web>
30+
</configuration>

‎ExampleWeb/Web.Release.config

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0"?>
2+
3+
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
4+
5+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
6+
<!--
7+
In the example below, the "SetAttributes" transform will change the value of
8+
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
9+
finds an atrribute "name" that has a value of "MyDB".
10+
11+
<connectionStrings>
12+
<add name="MyDB"
13+
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
14+
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
15+
</connectionStrings>
16+
-->
17+
<system.web>
18+
<compilation xdt:Transform="RemoveAttributes(debug)" />
19+
<!--
20+
In the example below, the "Replace" transform will replace the entire
21+
<customErrors> section of your web.config file.
22+
Note that because there is only one customErrors section under the
23+
<system.web> node, there is no need to use the "xdt:Locator" attribute.
24+
25+
<customErrors defaultRedirect="GenericError.htm"
26+
mode="RemoteOnly" xdt:Transform="Replace">
27+
<error statusCode="500" redirect="InternalError.htm"/>
28+
</customErrors>
29+
-->
30+
</system.web>
31+
</configuration>

‎ExampleWeb/Web.config

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
4+
<configSections>
5+
<section name="twitterApi" restartOnExternalChanges="true" requirePermission="false" type="Twitter.Api.TwitterSection, Twitter.Api" />
6+
</configSections>
7+
8+
<twitterApi userName="[YourTwitterUsername]">
9+
<consumerKey value="[YourConsumerKey]" />
10+
<consumerSecret value="[YourConsumerSecret]" />
11+
<accessToken value="[YourAccessToken]" />
12+
<accessTokenSecret value="[YourAccessTokenSecret]" />
13+
</twitterApi>
14+
15+
</configuration>

‎ExampleWeb/index.htm

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>Twitter API 1.1 Integration Demo</title>
5+
<style type="text/css">
6+
#tweets img, #tweets h1
7+
{
8+
margin-right:20px;
9+
display:inline;
10+
}
11+
#tweets>div { margin-top:20px; }
12+
</style>
13+
</head>
14+
<body>
15+
<div id="tweets">
16+
</div>
17+
18+
<!-- jQuery CDN -->
19+
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
20+
21+
<!-- MomentJs CDN for formatting dates -->
22+
<script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/2.0.0/moment.min.js"></script>
23+
24+
<!-- Minified script to call the web service and render tweets -->
25+
<script type="text/javascript" src="/js/twitter.api.min.js"></script>
26+
</body>
27+
</html>

‎ExampleWeb/js/twitter.api.combined.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$(function () {
2+
$.ajax({
3+
type: "POST",
4+
data: "{count:10}",
5+
dataType: "json",
6+
url: "/Timeline.asmx/GetTweets",
7+
contentType: "application/json; charset=utf-8",
8+
success: onSuccess,
9+
cache: false,
10+
error: ajaxFailed
11+
});
12+
});
13+
14+
function onSuccess(data, status) {
15+
$("#tweets").empty();
16+
for (var i = 0; i < data.d.length; i++) {
17+
$("#tweets").append("<div>" +
18+
" <div><img src=\"" + data.d[i].ProfileImage + "\" alt=\"\"/>" +
19+
" <h1>" + data.d[i].DisplayName + "</h1>" +
20+
" </div>" +
21+
" <div>" + data.d[i].StatusHtml + "</div>" +
22+
"</div>");
23+
}
24+
}
25+
26+
function ajaxFailed(error) {
27+
}

‎ExampleWeb/js/twitter.api.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$(function () {
2+
$.ajax({
3+
type: "POST",
4+
data: "{count:10}",
5+
dataType: "json",
6+
url: "/Timeline.asmx/GetTweets",
7+
contentType: "application/json; charset=utf-8",
8+
success: onSuccess,
9+
cache: false,
10+
error: ajaxFailed
11+
});
12+
});
13+
14+
function onSuccess(data, status) {
15+
$("#tweets").empty();
16+
for (var i = 0; i < data.d.length; i++) {
17+
$("#tweets").append("<div>" +
18+
" <div><img src=\"" + data.d[i].ProfileImage + "\" alt=\"\"/>" +
19+
" <h1>" + data.d[i].DisplayName + "</h1>" +
20+
" </div>" +
21+
" <div>" + data.d[i].StatusHtml + "</div>" +
22+
"</div>");
23+
}
24+
}
25+
26+
function ajaxFailed(error) {
27+
}

‎ExampleWeb/js/twitter.api.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎External Dlls/Newtonsoft.Json.dll

383 KB
Binary file not shown.
File renamed without changes.
46 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("Twitter.Ajax")]
6+
[assembly: AssemblyDescription("")]
7+
[assembly: AssemblyConfiguration("")]
8+
[assembly: AssemblyCompany("")]
9+
[assembly: AssemblyProduct("Twitter.Ajax")]
10+
[assembly: AssemblyCopyright("Copyright © 2013 uApe Ecommerce Limited")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
[assembly: ComVisible(false)]
14+
[assembly: Guid("68e8537b-9a26-4860-92d6-5d10ea7f5e8f")]
15+
[assembly: AssemblyVersion("1.0.0.0")]
16+
[assembly: AssemblyFileVersion("1.0.0.0")]

‎Twitter.Ajax/Timeline.asmx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ WebService Language="C#" CodeBehind="Timeline.asmx.cs" Class="Twitter.Ajax.Timeline" %>

‎Twitter.Ajax/Timeline.asmx.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Services;
6+
using Twitter.Api;
7+
8+
namespace Twitter.Ajax
9+
{
10+
/// <summary>
11+
/// A web service to provide ajax Twitter functionality.
12+
/// </summary>
13+
[WebService(Namespace = "http://uape.co.uk/")]
14+
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
15+
[System.ComponentModel.ToolboxItem(false)]
16+
[System.Web.Script.Services.ScriptService]
17+
public class Timeline : System.Web.Services.WebService
18+
{
19+
[WebMethod]
20+
public Tweet[] GetTweets(Int32 count)
21+
{
22+
String apiUrl = "https://api.twitter.com/1.1/statuses/user_timeline.json?owner_screen_name={0}&count={1}";
23+
24+
TwitterSection config =
25+
(TwitterSection)System.Configuration.ConfigurationManager.GetSection("twitterApi");
26+
27+
var twitter = new Tweet(config.ConsumerKey.Value,
28+
config.ConsumerSecret.Value,
29+
config.AccessToken.Value,
30+
config.AccessTokenSecret.Value);
31+
var tweets = twitter.GetTimeline(String.Format(apiUrl, config.UserName, count.ToString()));
32+
33+
return tweets.ToArray();
34+
}
35+
}
36+
}

‎Twitter.Ajax/Twitter.Ajax.csproj

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>
7+
</ProductVersion>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectGuid>{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}</ProjectGuid>
10+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
11+
<OutputType>Library</OutputType>
12+
<AppDesignerFolder>Properties</AppDesignerFolder>
13+
<RootNamespace>Twitter.Ajax</RootNamespace>
14+
<AssemblyName>Twitter.Ajax</AssemblyName>
15+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
16+
<UseIISExpress>false</UseIISExpress>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Microsoft.CSharp" />
37+
<Reference Include="System.Web.DynamicData" />
38+
<Reference Include="System.Web.Entity" />
39+
<Reference Include="System.Web.ApplicationServices" />
40+
<Reference Include="System" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="System.Web.Extensions" />
45+
<Reference Include="System.Xml.Linq" />
46+
<Reference Include="System.Drawing" />
47+
<Reference Include="System.Web" />
48+
<Reference Include="System.Xml" />
49+
<Reference Include="System.Configuration" />
50+
<Reference Include="System.Web.Services" />
51+
<Reference Include="System.EnterpriseServices" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<Compile Include="Properties\AssemblyInfo.cs" />
55+
<Compile Include="Timeline.asmx.cs">
56+
<DependentUpon>Timeline.asmx</DependentUpon>
57+
<SubType>Component</SubType>
58+
</Compile>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Content Include="Timeline.asmx" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<ProjectReference Include="..\Twitter.Api\Twitter.Api.csproj">
65+
<Project>{13C25403-26C4-498B-A2A5-1F62DF34E105}</Project>
66+
<Name>Twitter.Api</Name>
67+
</ProjectReference>
68+
</ItemGroup>
69+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
70+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
71+
<ProjectExtensions>
72+
<VisualStudio>
73+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
74+
<WebProjectProperties>
75+
<UseIIS>False</UseIIS>
76+
<AutoAssignPort>True</AutoAssignPort>
77+
<DevelopmentServerPort>44935</DevelopmentServerPort>
78+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
79+
<IISUrl>
80+
</IISUrl>
81+
<NTLMAuthentication>False</NTLMAuthentication>
82+
<UseCustomServer>False</UseCustomServer>
83+
<CustomServerUrl>
84+
</CustomServerUrl>
85+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
86+
</WebProjectProperties>
87+
</FlavorProperties>
88+
</VisualStudio>
89+
</ProjectExtensions>
90+
<PropertyGroup>
91+
<PostBuildEvent>copy $(TargetPath) $(SolutionDir)ExampleWeb\bin
92+
copy $(SolutionDir)Twitter.Ajax\Timeline.asmx $(SolutionDir)ExampleWeb</PostBuildEvent>
93+
</PropertyGroup>
94+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
95+
Other similar extension points exist, see Microsoft.Common.targets.
96+
<Target Name="BeforeBuild">
97+
</Target>
98+
<Target Name="AfterBuild">
99+
</Target>
100+
-->
101+
</Project>

‎Twitter.Api/ConfigValueElement.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Configuration;
6+
using System.Xml;
7+
8+
namespace Twitter.Api
9+
{
10+
public class ConfigValueElement : ConfigurationElement
11+
{
12+
[ConfigurationProperty("value", DefaultValue = "", IsRequired = true)]
13+
public String Value
14+
{
15+
get
16+
{
17+
return (String)this["value"];
18+
}
19+
set
20+
{
21+
this["value"] = value;
22+
}
23+
}
24+
}
25+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyTitle("Twitter.Api")]
6+
[assembly: AssemblyDescription("")]
7+
[assembly: AssemblyConfiguration("")]
8+
[assembly: AssemblyCompany("")]
9+
[assembly: AssemblyProduct("Twitter.Api")]
10+
[assembly: AssemblyCopyright("Copyright © 2013 uApe Ecommerce Limited")]
11+
[assembly: AssemblyTrademark("")]
12+
[assembly: AssemblyCulture("")]
13+
[assembly: ComVisible(false)]
14+
[assembly: Guid("c712d95b-717c-45ce-b600-0b2b0d6e75c9")]
15+
[assembly: AssemblyVersion("1.0.1.0")]
16+
[assembly: AssemblyFileVersion("1.0.1.0")]

‎TwitterAPI/Tweet.cs renamed to ‎Twitter.Api/Tweet.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace TwitterAPI
1+
namespace Twitter.Api
22
{
33
using System;
44
using System.Collections.Generic;
@@ -153,23 +153,23 @@ private String performRequest(string method, string url)
153153

154154
String signatureBaseString = "GET&" + lowercaseEncodings(strippedUrl) + "&" +
155155
(String.IsNullOrEmpty(countParam) ? String.Empty : lowercaseEncodings(countParam) + "%26") +
156-
"oauth_consumer_key%3D" + lowercaseEncodings(ApiKey) + "%26" +
156+
"oauth_consumer_key%3D" + lowercaseEncodings(ConsumerKey) + "%26" +
157157
"oauth_nonce%3D" + lowercaseEncodings(nonce) + "%26" +
158158
"oauth_signature_method%3DHMAC-SHA1%26" +
159159
"oauth_timestamp%3D" + timestamp + "%26" +
160-
"oauth_token%3D" + lowercaseEncodings(ApiToken) + "%26" +
160+
"oauth_token%3D" + lowercaseEncodings(AccessToken) + "%26" +
161161
"oauth_version%3D1.0" + restParams;
162162

163-
String sig = encode(signatureBaseString, Encoding.Default.GetBytes(ConsumerSecret + "&" + TokenSecret));
163+
String sig = encode(signatureBaseString, Encoding.Default.GetBytes(ConsumerSecret + "&" + AccessTokenSecret));
164164

165165
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
166166
request.Method = method;
167-
request.Headers.Add("Authorization", @"OAuth oauth_consumer_key=""" + ApiKey + @""",
167+
request.Headers.Add("Authorization", @"OAuth oauth_consumer_key=""" + ConsumerKey + @""",
168168
oauth_nonce=""" + nonce + @""",
169169
oauth_signature=""" + lowercaseEncodings(sig) + @""",
170170
oauth_signature_method=""HMAC-SHA1"",
171171
oauth_timestamp=""" + timestamp + @""",
172-
oauth_token=""" + ApiToken + @""",
172+
oauth_token=""" + AccessToken + @""",
173173
oauth_version=""1.0""");
174174
String responseString = String.Empty;
175175
try

‎TwitterAPI/TwitterAPI.csproj renamed to ‎Twitter.Api/Twitter.Api.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<ProjectGuid>{13C25403-26C4-498B-A2A5-1F62DF34E105}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>TwitterAPI</RootNamespace>
12-
<AssemblyName>TwitterAPI</AssemblyName>
11+
<RootNamespace>Twitter.Api</RootNamespace>
12+
<AssemblyName>Twitter.Api</AssemblyName>
1313
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
</PropertyGroup>
@@ -35,6 +35,7 @@
3535
<HintPath>..\DLLs\Newtonsoft.Json.dll</HintPath>
3636
</Reference>
3737
<Reference Include="System" />
38+
<Reference Include="System.configuration" />
3839
<Reference Include="System.Core" />
3940
<Reference Include="System.Data.Linq" />
4041
<Reference Include="System.Web" />
@@ -45,10 +46,15 @@
4546
<Reference Include="System.Xml" />
4647
</ItemGroup>
4748
<ItemGroup>
49+
<Compile Include="ConfigValueElement.cs" />
50+
<Compile Include="TwitterSection.cs" />
4851
<Compile Include="Properties\AssemblyInfo.cs" />
4952
<Compile Include="Tweet.cs" />
5053
</ItemGroup>
5154
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
55+
<PropertyGroup>
56+
<PostBuildEvent>copy $(TargetPath) $(SolutionDir)ExampleWeb\bin</PostBuildEvent>
57+
</PropertyGroup>
5258
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
5359
Other similar extension points exist, see Microsoft.Common.targets.
5460
<Target Name="BeforeBuild">

‎Twitter.Api/TwitterSection.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using System;
2+
using System.Collections;
3+
using System.Text;
4+
using System.Configuration;
5+
using System.Xml;
6+
7+
namespace Twitter.Api
8+
{
9+
public class TwitterSection : ConfigurationSection
10+
{
11+
[ConfigurationProperty("userName", DefaultValue = "[YourTwitterUsername]", IsRequired = true)]
12+
public String UserName
13+
{
14+
get
15+
{
16+
return (String)this["userName"];
17+
}
18+
set
19+
{
20+
this["userName"] = value;
21+
}
22+
}
23+
24+
[ConfigurationProperty("consumerKey", DefaultValue = "[YourConsumerKey]")]
25+
public ConfigValueElement ConsumerKey
26+
{
27+
get
28+
{
29+
return (ConfigValueElement)this["consumerKey"];
30+
}
31+
set
32+
{ this["consumerKey"] = value; }
33+
}
34+
35+
[ConfigurationProperty("consumerSecret", DefaultValue="[YourConsumerSecret]")]
36+
public ConfigValueElement ConsumerSecret
37+
{
38+
get
39+
{
40+
return (ConfigValueElement)this["consumerSecret"];
41+
}
42+
set
43+
{ this["consumerSecret"] = value; }
44+
}
45+
46+
[ConfigurationProperty("accessToken", DefaultValue = "[YourAccessToken]")]
47+
public ConfigValueElement AccessToken
48+
{
49+
get
50+
{
51+
return (ConfigValueElement)this["accessToken"];
52+
}
53+
set
54+
{ this["accessToken"] = value; }
55+
}
56+
57+
[ConfigurationProperty("accessTokenSecret", DefaultValue = "[YourAccessTokenSecret]")]
58+
public ConfigValueElement AccessTokenSecret
59+
{
60+
get
61+
{
62+
return (ConfigValueElement)this["accessTokenSecret"];
63+
}
64+
set
65+
{ this["accessTokenSecret"] = value; }
66+
}
67+
}
68+
}

‎TwitterAPI.sln

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 11.00
33
# Visual Studio 2010
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwitterAPI", "TwitterAPI\TwitterAPI.csproj", "{13C25403-26C4-498B-A2A5-1F62DF34E105}"
5-
EndProject
64
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example", "Example\Example.csproj", "{E5965550-D0E0-4621-AFA6-CE2F37772F6F}"
75
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Twitter.Api", "Twitter.Api\Twitter.Api.csproj", "{13C25403-26C4-498B-A2A5-1F62DF34E105}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Twitter.Ajax", "Twitter.Ajax\Twitter.Ajax.csproj", "{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleWeb", "ExampleWeb\ExampleWeb.csproj", "{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}"
11+
EndProject
812
Global
913
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1014
Debug|Any CPU = Debug|Any CPU
@@ -15,16 +19,6 @@ Global
1519
Release|x86 = Release|x86
1620
EndGlobalSection
1721
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Any CPU.Build.0 = Debug|Any CPU
20-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
21-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
22-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|x86.ActiveCfg = Debug|Any CPU
23-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Any CPU.ActiveCfg = Release|Any CPU
24-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Any CPU.Build.0 = Release|Any CPU
25-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
26-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Mixed Platforms.Build.0 = Release|Any CPU
27-
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|x86.ActiveCfg = Release|Any CPU
2822
{E5965550-D0E0-4621-AFA6-CE2F37772F6F}.Debug|Any CPU.ActiveCfg = Debug|x86
2923
{E5965550-D0E0-4621-AFA6-CE2F37772F6F}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
3024
{E5965550-D0E0-4621-AFA6-CE2F37772F6F}.Debug|Mixed Platforms.Build.0 = Debug|x86
@@ -35,6 +29,35 @@ Global
3529
{E5965550-D0E0-4621-AFA6-CE2F37772F6F}.Release|Mixed Platforms.Build.0 = Release|x86
3630
{E5965550-D0E0-4621-AFA6-CE2F37772F6F}.Release|x86.ActiveCfg = Release|x86
3731
{E5965550-D0E0-4621-AFA6-CE2F37772F6F}.Release|x86.Build.0 = Release|x86
32+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
35+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
36+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Debug|x86.ActiveCfg = Debug|Any CPU
37+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Any CPU.ActiveCfg = Release|Any CPU
38+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Any CPU.Build.0 = Release|Any CPU
39+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
40+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|Mixed Platforms.Build.0 = Release|Any CPU
41+
{13C25403-26C4-498B-A2A5-1F62DF34E105}.Release|x86.ActiveCfg = Release|Any CPU
42+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
44+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
45+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
46+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Debug|x86.ActiveCfg = Debug|Any CPU
47+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
50+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
51+
{43C0EB13-9F3E-484C-B75D-B56CCB099EF5}.Release|x86.ActiveCfg = Release|Any CPU
52+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Debug|Any CPU.Build.0 = Debug|Any CPU
54+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
55+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Debug|x86.ActiveCfg = Debug|Any CPU
56+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Release|Any CPU.ActiveCfg = Release|Any CPU
57+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Release|Any CPU.Build.0 = Release|Any CPU
58+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
59+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Release|Mixed Platforms.Build.0 = Release|Any CPU
60+
{51EE6F7D-C919-4EC6-89D0-67F0B64C6B34}.Release|x86.ActiveCfg = Release|Any CPU
3861
EndGlobalSection
3962
GlobalSection(SolutionProperties) = preSolution
4063
HideSolutionNode = FALSE

‎TwitterAPI/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

‎Umbraco Package/Twitter.Api_1.0.zip

27.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.