Skip to content
New issue

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

Clarify behavior of “after” parameter in reddit.Scanner.Listing #71

Open
J-Thompson12 opened this issue Apr 3, 2020 · 6 comments
Open

Comments

@J-Thompson12
Copy link

J-Thompson12 commented Apr 3, 2020

in reddit scanner.go you have the after var getting set to before. This is breaking pagination

func (s *scanner) Listing(path, after string) (Harvest, error) {
	return s.r.reap(
		path, map[string]string{
			"raw_json": "1",
			"limit":    "100",
			"before":    after,
		},
	)
}
@turnage
Copy link
Owner

turnage commented Apr 3, 2020 via email

@turnage turnage closed this as completed Apr 3, 2020
@turnage
Copy link
Owner

turnage commented Apr 3, 2020

I’ll re-open this until the a comment about this is added to clear up confusion in the future. Unfortunately I think that’s the best that can be done without breaking users.

@turnage turnage reopened this Apr 3, 2020
@turnage turnage changed the title fix after Clarify behavior of “after” parameter in reddit.Scanner.Listing Apr 3, 2020
@J-Thompson12
Copy link
Author

I just pulled in 200 mentions using pagination with after and it pulled in the second page with all comments createdUTC earlier than the first page

@turnage
Copy link
Owner

turnage commented Apr 3, 2020

With which meaning of the parameter “after”? If you pass “after” to Reddit, you will get what is chronologically before. If you pass “after” to reddit.Scanner.Listing, I believe you will receive what comes chronologically after.

This is the way all of the streams in graw work.

@J-Thompson12
Copy link
Author

J-Thompson12 commented Apr 3, 2020

i used the listingWithParams set to after and got the createdUTC times

end of page 1.             beginning of page 2
1585763973                1585762846
1585763157                 1585761938
1585763134                  1585761819
1585763072.                1585761806
1585763016.                 1585761502
1585763009.                 1585761462

@turnage
Copy link
Owner

turnage commented Apr 3, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants