We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Howdy all y'all,
I'm trying to find and display a post's header image.
Is this a good place to look for it?
posts, resp, err = cl.Subreddit.TopPosts(ctx, subreddit, &reddit.ListPostOptions{ ListOptions: reddit.ListOptions{ Limit: maxRedditItems, After: respAfter, }, Time: "all", }) var thePosts []*reddit.Post = nil for _, post := range posts { lastByByte := strings.ToLower(post.URL[len(post.URL)-4:]) if (lastByByte == ".jpg") || (lastByByte == ".png") { log.Println("URL is an image:", post.URL) } else { log.Println("URL is NOT an image:", post.URL) } thePosts = append(thePosts, post) }
Thanks for any help! Dale
The text was updated successfully, but these errors were encountered:
Is it a good assumption on my part to use:
log.Println("URL is an image:", post.URL)
as the post's image?
Sorry, something went wrong.
No branches or pull requests
Howdy all y'all,
I'm trying to find and display a post's header image.
Is this a good place to look for it?
Thanks for any help!
Dale
The text was updated successfully, but these errors were encountered: