Skip to content
Permalink
Browse files

First commit for publishing the project

  • Loading branch information
codingmag committed Jun 16, 2016
1 parent 3460550 commit 210e073afd89ea2a0ca03d1f8da6b10765d36dd0
Showing with 151,921 additions and 0 deletions.
  1. +36 −0 SocialMediaAdapters/Properties/AssemblyInfo.cs
  2. +110 −0 SocialMediaAdapters/SocialMediaAdapters.csproj
  3. +62 −0 SocialMediaAdapters/TwitterAdapter.cs
  4. +11 −0 SocialMediaAdapters/app.config
  5. +13 −0 SocialMediaAdapters/packages.config
  6. +28 −0 SocialMediaQuery.sln
  7. +35 −0 SocialMediaQuery/App_Start/BundleConfig.cs
  8. +13 −0 SocialMediaQuery/App_Start/FilterConfig.cs
  9. +23 −0 SocialMediaQuery/App_Start/RouteConfig.cs
  10. +24 −0 SocialMediaQuery/App_Start/WebApiConfig.cs
  11. +51 −0 SocialMediaQuery/Content/Site.css
  12. +6,816 −0 SocialMediaQuery/Content/bootstrap.css
  13. +20 −0 SocialMediaQuery/Content/bootstrap.min.css
  14. +29 −0 SocialMediaQuery/Controllers/ResultsController.cs
  15. +33 −0 SocialMediaQuery/Controllers/searchController.cs
  16. +1 −0 SocialMediaQuery/Global.asax
  17. +23 −0 SocialMediaQuery/Global.asax.cs
  18. +14 −0 SocialMediaQuery/Models/DataSource.cs
  19. +14 −0 SocialMediaQuery/Models/Results/TwitterSearch.cs
  20. +12 −0 SocialMediaQuery/Models/Search/Index.cs
  21. +151 −0 SocialMediaQuery/Project_Readme.html
  22. +35 −0 SocialMediaQuery/Properties/AssemblyInfo.cs
  23. BIN SocialMediaQuery/Scripts/_references.js
  24. +2,014 −0 SocialMediaQuery/Scripts/bootstrap.js
  25. +21 −0 SocialMediaQuery/Scripts/bootstrap.min.js
  26. +2,671 −0 SocialMediaQuery/Scripts/jquery-1.10.2.intellisense.js
  27. +9,803 −0 SocialMediaQuery/Scripts/jquery-1.10.2.js
  28. +23 −0 SocialMediaQuery/Scripts/jquery-1.10.2.min.js
  29. +1 −0 SocialMediaQuery/Scripts/jquery-1.10.2.min.map
  30. +1,302 −0 SocialMediaQuery/Scripts/jquery.validate-vsdoc.js
  31. +1,245 −0 SocialMediaQuery/Scripts/jquery.validate.js
  32. +16 −0 SocialMediaQuery/Scripts/jquery.validate.min.js
  33. +394 −0 SocialMediaQuery/Scripts/jquery.validate.unobtrusive.js
  34. +19 −0 SocialMediaQuery/Scripts/jquery.validate.unobtrusive.min.js
  35. +1,416 −0 SocialMediaQuery/Scripts/modernizr-2.6.2.js
  36. +340 −0 SocialMediaQuery/Scripts/respond.js
  37. +20 −0 SocialMediaQuery/Scripts/respond.min.js
  38. +234 −0 SocialMediaQuery/SocialMediaQuery.csproj
  39. +37 −0 SocialMediaQuery/Startup.cs
  40. +14 −0 SocialMediaQuery/Views/Results/TwitterSearch.cshtml
  41. +37 −0 SocialMediaQuery/Views/Search/Index.cshtml
  42. +17 −0 SocialMediaQuery/Views/Shared/Error.cshtml
  43. +42 −0 SocialMediaQuery/Views/Shared/_Layout.cshtml
  44. +35 −0 SocialMediaQuery/Views/Web.config
  45. +3 −0 SocialMediaQuery/Views/_ViewStart.cshtml
  46. +30 −0 SocialMediaQuery/Web.Debug.config
  47. +31 −0 SocialMediaQuery/Web.Release.config
  48. +51 −0 SocialMediaQuery/Web.config
  49. BIN SocialMediaQuery/favicon.ico
  50. BIN SocialMediaQuery/fonts/glyphicons-halflings-regular.eot
  51. +228 −0 SocialMediaQuery/fonts/glyphicons-halflings-regular.svg
  52. BIN SocialMediaQuery/fonts/glyphicons-halflings-regular.ttf
  53. BIN SocialMediaQuery/fonts/glyphicons-halflings-regular.woff
  54. +24 −0 SocialMediaQuery/packages.config
  55. BIN packages/Antlr.3.4.1.9004/Antlr.3.4.1.9004.nupkg
  56. BIN packages/Antlr.3.4.1.9004/lib/Antlr3.Runtime.dll
  57. +34 −0 packages/Microsoft.AspNet.Mvc.5.1.2/Content/Web.config.install.xdt
  58. +10 −0 packages/Microsoft.AspNet.Mvc.5.1.2/Content/Web.config.uninstall.xdt
  59. BIN packages/Microsoft.AspNet.Mvc.5.1.2/Microsoft.AspNet.Mvc.5.1.2.nupkg
  60. BIN packages/Microsoft.AspNet.Mvc.5.1.2/lib/net45/System.Web.Mvc.dll
  61. +11,126 −0 packages/Microsoft.AspNet.Mvc.5.1.2/lib/net45/System.Web.Mvc.xml
  62. BIN packages/Microsoft.AspNet.Razor.3.1.2/Microsoft.AspNet.Razor.3.1.2.nupkg
  63. BIN packages/Microsoft.AspNet.Razor.3.1.2/lib/net45/System.Web.Razor.dll
  64. +5,738 −0 packages/Microsoft.AspNet.Razor.3.1.2/lib/net45/System.Web.Razor.xml
  65. BIN packages/Microsoft.AspNet.Web.Optimization.1.1.3/Microsoft.AspNet.Web.Optimization.1.1.3.nupkg
  66. BIN packages/Microsoft.AspNet.Web.Optimization.1.1.3/lib/net40/System.Web.Optimization.dll
  67. +666 −0 packages/Microsoft.AspNet.Web.Optimization.1.1.3/lib/net40/system.web.optimization.xml
  68. BIN packages/Microsoft.AspNet.WebApi.5.1.2/Microsoft.AspNet.WebApi.5.1.2.nupkg
  69. BIN packages/Microsoft.AspNet.WebApi.Client.5.1.2/Microsoft.AspNet.WebApi.Client.5.1.2.nupkg
  70. BIN packages/Microsoft.AspNet.WebApi.Client.5.1.2/lib/net45/System.Net.Http.Formatting.dll
  71. +2,018 −0 packages/Microsoft.AspNet.WebApi.Client.5.1.2/lib/net45/System.Net.Http.Formatting.xml
  72. BIN ...ft.AspNet.WebApi.Client.5.1.2/lib/portable-wp8%2Bnetcore45%2Bnet45/System.Net.Http.Formatting.dll
  73. +4,025 −0 ...ft.AspNet.WebApi.Client.5.1.2/lib/portable-wp8%2Bnetcore45%2Bnet45/System.Net.Http.Formatting.xml
  74. +11 −0 packages/Microsoft.AspNet.WebApi.Core.5.1.2/Content/web.config.transform
  75. BIN packages/Microsoft.AspNet.WebApi.Core.5.1.2/Microsoft.AspNet.WebApi.Core.5.1.2.nupkg
  76. BIN packages/Microsoft.AspNet.WebApi.Core.5.1.2/lib/net45/System.Web.Http.dll
  77. +6,564 −0 packages/Microsoft.AspNet.WebApi.Core.5.1.2/lib/net45/System.Web.Http.xml
  78. BIN packages/Microsoft.AspNet.WebApi.WebHost.5.1.2/Microsoft.AspNet.WebApi.WebHost.5.1.2.nupkg
  79. BIN packages/Microsoft.AspNet.WebApi.WebHost.5.1.2/lib/net45/System.Web.Http.WebHost.dll
  80. +135 −0 packages/Microsoft.AspNet.WebApi.WebHost.5.1.2/lib/net45/System.Web.Http.WebHost.xml
  81. +41 −0 packages/Microsoft.AspNet.WebPages.3.1.2/Content/Web.config.install.xdt
  82. +13 −0 packages/Microsoft.AspNet.WebPages.3.1.2/Content/Web.config.uninstall.xdt
  83. BIN packages/Microsoft.AspNet.WebPages.3.1.2/Microsoft.AspNet.WebPages.3.1.2.nupkg
  84. BIN packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.Helpers.dll
  85. +836 −0 packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.Helpers.xml
  86. BIN packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.WebPages.Deployment.dll
  87. +60 −0 packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.WebPages.Deployment.xml
  88. BIN packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.WebPages.Razor.dll
  89. +292 −0 packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.WebPages.Razor.xml
  90. BIN packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.WebPages.dll
  91. +2,688 −0 packages/Microsoft.AspNet.WebPages.3.1.2/lib/net45/System.Web.WebPages.xml
  92. BIN packages/Microsoft.Web.Infrastructure.1.0.0.0/Microsoft.Web.Infrastructure.1.0.0.0.nupkg
  93. BIN packages/Microsoft.Web.Infrastructure.1.0.0.0/lib/net40/Microsoft.Web.Infrastructure.dll
  94. +394 −0 ...ages/Microsoft.jQuery.Unobtrusive.Validation.3.1.2/Content/Scripts/jquery.validate.unobtrusive.js
  95. +19 −0 .../Microsoft.jQuery.Unobtrusive.Validation.3.1.2/Content/Scripts/jquery.validate.unobtrusive.min.js
  96. BIN ...Microsoft.jQuery.Unobtrusive.Validation.3.1.2/Microsoft.jQuery.Unobtrusive.Validation.3.1.2.nupkg
  97. +1,416 −0 packages/Modernizr.2.6.2/Content/Scripts/modernizr-2.6.2.js
  98. BIN packages/Modernizr.2.6.2/Modernizr.2.6.2.nupkg
  99. +75 −0 packages/Modernizr.2.6.2/Tools/common.ps1
  100. +12 −0 packages/Modernizr.2.6.2/Tools/install.ps1
  101. +6 −0 packages/Modernizr.2.6.2/Tools/uninstall.ps1
  102. BIN packages/Newtonsoft.Json.5.0.6/Newtonsoft.Json.5.0.6.nupkg
  103. BIN packages/Newtonsoft.Json.5.0.6/lib/net20/Newtonsoft.Json.dll
  104. +8,893 −0 packages/Newtonsoft.Json.5.0.6/lib/net20/Newtonsoft.Json.xml
  105. BIN packages/Newtonsoft.Json.5.0.6/lib/net35/Newtonsoft.Json.dll
  106. +8,030 −0 packages/Newtonsoft.Json.5.0.6/lib/net35/Newtonsoft.Json.xml
  107. BIN packages/Newtonsoft.Json.5.0.6/lib/net40/Newtonsoft.Json.dll
  108. +8,305 −0 packages/Newtonsoft.Json.5.0.6/lib/net40/Newtonsoft.Json.xml
  109. BIN packages/Newtonsoft.Json.5.0.6/lib/net45/Newtonsoft.Json.dll
  110. +8,305 −0 packages/Newtonsoft.Json.5.0.6/lib/net45/Newtonsoft.Json.xml
  111. BIN packages/Newtonsoft.Json.5.0.6/lib/netcore45/Newtonsoft.Json.dll
  112. +7,829 −0 packages/Newtonsoft.Json.5.0.6/lib/netcore45/Newtonsoft.Json.xml
  113. BIN packages/Newtonsoft.Json.5.0.6/lib/portable-net40%2Bsl4%2Bwp7%2Bwin8/Newtonsoft.Json.dll
  114. +7,457 −0 packages/Newtonsoft.Json.5.0.6/lib/portable-net40%2Bsl4%2Bwp7%2Bwin8/Newtonsoft.Json.xml
  115. BIN packages/Newtonsoft.Json.5.0.6/lib/portable-net45%2Bwp80%2Bwin8/Newtonsoft.Json.dll
  116. +7,829 −0 packages/Newtonsoft.Json.5.0.6/lib/portable-net45%2Bwp80%2Bwin8/Newtonsoft.Json.xml
  117. BIN packages/Respond.1.2.0/Respond.1.2.0.nupkg
  118. +340 −0 packages/Respond.1.2.0/content/Scripts/respond.js
  119. +20 −0 packages/Respond.1.2.0/content/Scripts/respond.min.js
  120. BIN packages/WebGrease.1.5.2/WebGrease.1.5.2.nupkg
  121. BIN packages/WebGrease.1.5.2/lib/WebGrease.dll
  122. BIN packages/WebGrease.1.5.2/tools/WG.exe
  123. BIN packages/bootstrap.3.0.0/bootstrap.3.0.0.nupkg
  124. +6,816 −0 packages/bootstrap.3.0.0/content/Content/bootstrap.css
  125. +20 −0 packages/bootstrap.3.0.0/content/Content/bootstrap.min.css
  126. +2,014 −0 packages/bootstrap.3.0.0/content/Scripts/bootstrap.js
  127. +21 −0 packages/bootstrap.3.0.0/content/Scripts/bootstrap.min.js
  128. BIN packages/bootstrap.3.0.0/content/fonts/glyphicons-halflings-regular.eot
  129. +228 −0 packages/bootstrap.3.0.0/content/fonts/glyphicons-halflings-regular.svg
  130. BIN packages/bootstrap.3.0.0/content/fonts/glyphicons-halflings-regular.ttf
  131. BIN packages/bootstrap.3.0.0/content/fonts/glyphicons-halflings-regular.woff
  132. +6,748 −0 packages/jQuery.1.10.2/Content/Scripts/jquery-1.10.2-vsdoc.js
  133. +9,803 −0 packages/jQuery.1.10.2/Content/Scripts/jquery-1.10.2.js
  134. +23 −0 packages/jQuery.1.10.2/Content/Scripts/jquery-1.10.2.min.js
  135. +1 −0 packages/jQuery.1.10.2/Content/Scripts/jquery-1.10.2.min.map
  136. +117 −0 packages/jQuery.1.10.2/Tools/common.ps1
  137. +41 −0 packages/jQuery.1.10.2/Tools/install.ps1
  138. +2,671 −0 packages/jQuery.1.10.2/Tools/jquery-1.10.2.intellisense.js
  139. +41 −0 packages/jQuery.1.10.2/Tools/uninstall.ps1
  140. BIN packages/jQuery.1.10.2/jQuery.1.10.2.nupkg
  141. +1,302 −0 packages/jQuery.Validation.1.11.1/Content/Scripts/jquery.validate-vsdoc.js
  142. +1,245 −0 packages/jQuery.Validation.1.11.1/Content/Scripts/jquery.validate.js
  143. +16 −0 packages/jQuery.Validation.1.11.1/Content/Scripts/jquery.validate.min.js
  144. BIN packages/jQuery.Validation.1.11.1/jQuery.Validation.1.11.1.nupkg
  145. +5 −0 packages/repositories.config
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SocialMediaAdapters")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("SocialMediaAdapters")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b4ac75fc-1fa8-488a-bdf3-0610f9aec93a")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A00B5F39-5D8A-4267-94C6-186F318F3158}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SocialMediaAdapters</RootNamespace>
<AssemblyName>SocialMediaAdapters</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="LinqToTwitter.AspNet, Version=3.2.0.30483, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\linqtotwitter.4.1.0\lib\net45\LinqToTwitter.AspNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="LinqToTwitter.net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=957107be965c25d9, processorArchitecture=MSIL">
<HintPath>..\packages\linqtotwitter.4.1.0\lib\net45\LinqToTwitter.net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Linq, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.PlatformServices, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.Helpers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.1.2\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.Razor.3.1.2\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.WebPages.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.2\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="TwitterAdapter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SocialMediaAdapters
{
using System.Web;
using System.Web.Mvc;

using LinqToTwitter;

public static class TwitterAdapter
{
public static string ConsumerKey;

public static string ConsumerSecret;

public static async Task<string> SearchAsync(string query)
{
var auth = new ApplicationOnlyAuthorizer()
{
CredentialStore =
new SessionStateCredentialStore()
{
ConsumerKey = ConsumerKey,
ConsumerSecret = ConsumerSecret,
}
};

await auth.AuthorizeAsync();

var twitterCtx = new TwitterContext(auth);

var searchResults =
(from search in twitterCtx.Search
where search.Type == SearchType.Search &&
search.Query == query
select search.Statuses)
.SingleOrDefault();

var serializedResults = new StringBuilder();

if (searchResults != null && searchResults.Count > 0)
{
foreach (var result in searchResults)
{
serializedResults.AppendFormat(
"<blockquote class=\"twitter-tweet\"><p>{0}</p><p><a href=\"{1}\"><img src=\"{2}\"/>{3}</a> - {4}</p></blockquote>",
result.Text,
result.User.Url,
result.User.ProfileImageUrl,
result.User.ScreenNameResponse,
result.CreatedAt);
}
}

return serializedResults.ToString();
}
}
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="linqtotwitter" version="4.1.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.1.2" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.1.2" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.1.2" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Rx-Core" version="2.2.5" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net45" />
<package id="Rx-Linq" version="2.2.5" targetFramework="net45" />
<package id="Rx-Main" version="2.2.5" targetFramework="net45" />
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="net45" />
</packages>
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocialMediaQuery", "SocialMediaQuery\SocialMediaQuery.csproj", "{8F51B2E1-6045-433E-9567-27F38E8D04CD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocialMediaAdapters", "SocialMediaAdapters\SocialMediaAdapters.csproj", "{A00B5F39-5D8A-4267-94C6-186F318F3158}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F51B2E1-6045-433E-9567-27F38E8D04CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F51B2E1-6045-433E-9567-27F38E8D04CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F51B2E1-6045-433E-9567-27F38E8D04CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F51B2E1-6045-433E-9567-27F38E8D04CD}.Release|Any CPU.Build.0 = Release|Any CPU
{A00B5F39-5D8A-4267-94C6-186F318F3158}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A00B5F39-5D8A-4267-94C6-186F318F3158}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A00B5F39-5D8A-4267-94C6-186F318F3158}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A00B5F39-5D8A-4267-94C6-186F318F3158}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,35 @@
using System.Web;
using System.Web.Optimization;

namespace SocialMediaQuery
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));

bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));

bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));

// Set EnableOptimizations to false for debugging. For more information,
// visit http://go.microsoft.com/fwlink/?LinkId=301862
BundleTable.EnableOptimizations = true;
}
}
}
@@ -0,0 +1,13 @@
using System.Web;
using System.Web.Mvc;

namespace SocialMediaQuery
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace SocialMediaQuery
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{query}",
defaults: new { controller = "Search", action = "Index", query = UrlParameter.Optional }
);
}
}
}
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;

namespace SocialMediaQuery
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}

0 comments on commit 210e073

Please sign in to comment.
You can’t perform that action at this time.