Skip to content

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

+5-5
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

+4-4
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

+1-21
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

+105
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

+16
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

+1
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

+30
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

+31
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

+15
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

+27
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

+27
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

+27
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

+1
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.
+16
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

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

0 commit comments

Comments
 (0)
Please sign in to comment.