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

Adding offset, min, and max options to allow for complete collection on keywords using the search function #6

Merged
merged 4 commits into from
Aug 18, 2022

Conversation

patrick-lee-warren
Copy link
Contributor

This is literally by first pull request ever, so be gentle.

Usage is something like this:

min=108789781130656241
gap=100000000000
cycles=100
term='Russia'

search_count=30
page=0
status_list=[]

for cycle in range(0,cycles):
    search_count=30
    page=0
    while search_count>0:
        temp=test_api.search('statuses', term, 40, 4,40*page, str(min+cycle*gap),str(min+(cycle+1)*gap) )['statuses']
        status_list=status_list+temp
        search_count=len(temp)
        page+=1


),
)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove the else to fit the

if y:
    return a
return b

pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that better practice? I just kludge things. Happy to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

conform to
if y: return a
   return b

standard.
@lxcode lxcode merged commit 0d07771 into stanfordio:main Aug 18, 2022
@lxcode
Copy link
Contributor

lxcode commented Aug 18, 2022

Merging: we should still put pagination support in there, but it doesn't cause any regressions and gives us a framework for some future additions. Thanks!

@lxcode
Copy link
Contributor

lxcode commented Aug 19, 2022

(cleaning up previous discussion to prevent confusion, sorry)

Ok, pagination logic is added now, let me know if you find any problems with it.

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

Successfully merging this pull request may close these issues.

3 participants