so he’s got his user agent in the code set to farts but he’s actually using Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0 from several different IPs but I have several means to deal with him now
private async Task<ExtractedTweet> TweetFromSyndication(long statusId) { string reqURL = $"https://cdn.syndication.twimg.com/tweet-result?id={statusId}&lang=en&token=3ykp5xr72qv"; JsonDocument tweet; var client = _httpClientFactory.CreateClient(); using var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri($"https://cdn.syndication.twimg.com/tweet-result?id={statusId}&lang=en&token=3ykp5xr72qv"), }; //request.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"); request.Headers.Add("User-Agent", "farts"); //using var request = new HttpRequestMessage(new HttpMethod("GET"), reqURL); //using var request = _twitterAuthenticationInitializer.MakeHttpRequest(HttpMethod.Get, reqURL, false); using var httpResponse = await client.SendAsync(request); if (httpResponse.StatusCode == HttpStatusCode.Unauthorized) { _logger.LogError("Error retrieving tweet {statusId}; refreshing client", statusId); }jesse, lets cook
edit: forgot source
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.