You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the right AppID, as well as the correct secret code, but still, I get this
Reddit.Exceptions.RedditForbiddenException: 'Reddit API returned Forbidden (403) response.'
I'm trying to access posts on a subreddit.
the code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using Reddit;
using Reddit.Controllers;
using Reddit.Things;
namespace CashCowByJansson
{
public class RedditStorieScrapper
{
public string Seceret { get; set; }
public string AppID { get; set; }
public string Storries { get; set; }
public string Story { get; set; }
public RedditStorieScrapper(string seceret, string appID)
{
Storries = File.ReadAllText("..\..\Buffer\StoriesHistory.txt");
Seceret = seceret;
AppID = appID;
Story = RetrievePost();
}
public string RetrievePost()
{
RedditClient redditClient = new RedditClient(appId: AppID, appSecret: Seceret);
var subReddit = redditClient.Subreddit("nosleep");
List<Reddit.Controllers.Post> posts = subReddit.Posts.GetHot(limit: 100).ToList();
foreach (var post in posts)
{
if (!Storries.Contains(post.ToString()))
{
return post.ToString();
}
}
return "";
}
}
}
The text was updated successfully, but these errors were encountered:
I'm using the right AppID, as well as the correct secret code, but still, I get this
Reddit.Exceptions.RedditForbiddenException: 'Reddit API returned Forbidden (403) response.'
I'm trying to access posts on a subreddit.
the code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using Reddit;
using Reddit.Controllers;
using Reddit.Things;
namespace CashCowByJansson
{
public class RedditStorieScrapper
{
public string Seceret { get; set; }
public string AppID { get; set; }
public string Storries { get; set; }
public string Story { get; set; }
public RedditStorieScrapper(string seceret, string appID)
{
Storries = File.ReadAllText("..\..\Buffer\StoriesHistory.txt");
Seceret = seceret;
AppID = appID;
Story = RetrievePost();
}
}
The text was updated successfully, but these errors were encountered: