This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Edit: Never mind, I'm upping the last character with 1 of the variable. So u becomes v, v becomes w etc. That loops until it's got more than 1 result in the output variable
$newlatest = $latest[0..5] [char]($latest[6]/1 1) | out-string -NoNewline
This'll probably lead to issues when it runs past Z but I'll deal with that then ;)
Hey all,
I've written a couple of Powershell scripts to query the API and automate a number of actions. However, I've resorted to polling the API because the before parameter stops giving posts back when the post gets removed/deleted.
Request: https://oauth.reddit.com/r/$subname/about/log?limit=25&before=$beforeThe $subname is the subreddit in question, the $before the last known post. When API returns 25 posts it loops through the request until there are less than 25 results (because Rpi's aren't known for their stability).
However, when the $before value has a post id of a post that has been removed, the request returns:
kind data
---- ----
Listing @{after=; dist=0; modhash=; geo_filter=; children=System.Object[]; before=}
I'm not sure how to circumvent this issue, the only thing I can see is to do a 2nd request with the before-variable as empty so that it'll just get the last 25 posts, potentially skipping those that were posted but fall outside the limit.And yes, I know the limit is 100 posts but one of the subs my script helps mod has over 100 posts in an 8 to 12 hour timeframe. So even with 100 posts limit I can miss posts when the outage starts at bedtime and I check it in the morning.
That said, it's not a critical problem, the most important function (modding based on flairs) runs on the modlog and that log beautifully handles the before-query 😊
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...