added twitter credentials
This commit is contained in:
parent
796004fa59
commit
b0ef1526b1
|
@ -4,4 +4,8 @@
|
|||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="TweetinviAPI" Version="4.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -3,17 +3,18 @@
|
|||
public class TwitterSettings
|
||||
{
|
||||
#region Ctor
|
||||
public TwitterSettings()
|
||||
public TwitterSettings(string apiKey, string consumerKey, string consumerSecret, string accessToken, string accessTokenSecret)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TwitterSettings(string apiKey)
|
||||
{
|
||||
ApiKey = apiKey;
|
||||
ConsumerKey = consumerKey;
|
||||
ConsumerSecret = consumerSecret;
|
||||
AccessToken = accessToken;
|
||||
AccessTokenSecret = accessTokenSecret;
|
||||
}
|
||||
#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 BirdsiteLive.Twitter.Settings;
|
||||
using Tweetinvi;
|
||||
|
||||
namespace BirdsiteLive.Twitter
|
||||
{
|
||||
|
@ -17,5 +18,10 @@ namespace BirdsiteLive.Twitter
|
|||
_settings = settings;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void GetUser(string username)
|
||||
{
|
||||
var user = User.GetUserFromScreenName(username);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,10 @@ namespace BirdsiteLive
|
|||
var twitterSettings = Configuration.GetSection("Twitter").Get<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(_ =>
|
||||
{
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
"Domain": "domain.name"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"Twitter": {
|
||||
"ApiKey": "twitter.api.key"
|
||||
"ConsumerKey": "twitter.api.key",
|
||||
"ConsumerSecret": "twitter.api.key",
|
||||
"AccessToken": "twitter.api.key",
|
||||
"AccessTokenSecret": "twitter.api.key"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue