mirror of
https://github.com/NicolasConstant/BirdsiteLive
synced 2025-06-05 21:49:16 +02:00
added twitter credentials
This commit is contained in:
@@ -4,4 +4,8 @@
|
|||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="TweetinviAPI" Version="4.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -3,17 +3,18 @@
|
|||||||
public class TwitterSettings
|
public class TwitterSettings
|
||||||
{
|
{
|
||||||
#region Ctor
|
#region Ctor
|
||||||
public TwitterSettings()
|
public TwitterSettings(string apiKey, string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret)
|
||||||
{
|
{
|
||||||
|
ConsumerKey = consumerKey;
|
||||||
}
|
ConsumerSecret = consumerSecret;
|
||||||
|
AccessToken = accessToken;
|
||||||
public TwitterSettings(string apiKey)
|
AccessTokenSecret = accessTokenSecret;
|
||||||
{
|
|
||||||
ApiKey = apiKey;
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public string ApiKey { get; set; }
|
public string ConsumerKey { get; set; }
|
||||||
|
public string ConsumerSecret { get; set; }
|
||||||
|
public string AccessToken { get; set; }
|
||||||
|
public string AccessTokenSecret { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using BirdsiteLive.Twitter.Settings;
|
using BirdsiteLive.Twitter.Settings;
|
||||||
|
using Tweetinvi;
|
||||||
|
|
||||||
namespace BirdsiteLive.Twitter
|
namespace BirdsiteLive.Twitter
|
||||||
{
|
{
|
||||||
@@ -17,5 +18,10 @@ namespace BirdsiteLive.Twitter
|
|||||||
_settings = settings;
|
_settings = settings;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public void GetUser(string username)
|
||||||
|
{
|
||||||
|
var user = User.GetUserFromScreenName(username);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,10 @@ namespace BirdsiteLive
|
|||||||
var twitterSettings = Configuration.GetSection("Twitter").Get<TwitterSettings>();
|
var twitterSettings = Configuration.GetSection("Twitter").Get<TwitterSettings>();
|
||||||
|
|
||||||
services.For<TwitterSettings>().Use<TwitterSettings>()
|
services.For<TwitterSettings>().Use<TwitterSettings>()
|
||||||
.Ctor<string>("apiKey").Is(twitterSettings.ApiKey);
|
.Ctor<string>("accessToken").Is(twitterSettings.AccessToken)
|
||||||
|
.Ctor<string>("accessTokenSecret").Is(twitterSettings.AccessTokenSecret)
|
||||||
|
.Ctor<string>("consumerKey").Is(twitterSettings.ConsumerKey)
|
||||||
|
.Ctor<string>("consumerSecret").Is(twitterSettings.ConsumerSecret);
|
||||||
|
|
||||||
services.Scan(_ =>
|
services.Scan(_ =>
|
||||||
{
|
{
|
||||||
|
@@ -10,6 +10,9 @@
|
|||||||
"Domain": "domain.name"
|
"Domain": "domain.name"
|
||||||
},
|
},
|
||||||
"Twitter": {
|
"Twitter": {
|
||||||
"ApiKey": "twitter.api.key"
|
"ConsumerKey": "twitter.api.key",
|
||||||
|
"ConsumerSecret": "twitter.api.key",
|
||||||
|
"AccessToken": "twitter.api.key",
|
||||||
|
"AccessTokenSecret": "twitter.api.key"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,6 +11,9 @@
|
|||||||
"Domain": "domain.name"
|
"Domain": "domain.name"
|
||||||
},
|
},
|
||||||
"Twitter": {
|
"Twitter": {
|
||||||
"ApiKey": "twitter.api.key"
|
"ConsumerKey": "twitter.api.key",
|
||||||
|
"ConsumerSecret": "twitter.api.key",
|
||||||
|
"AccessToken": "twitter.api.key",
|
||||||
|
"AccessTokenSecret": "twitter.api.key"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user