question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

request_url_callback

See original GitHub issue

Hello I don’t understand how request_url_callback works I save last URL and change account after 50 post but it don’t continue after last post here is my code snippet

def handle_pagination_url(url):
    global start_url
    start_url = url

for page in PAGES:
    while True:
        posts = get_posts(page, credentials=next(accounts),
                          options={"comments": True, 
                                   "reactors": True, 
                                   "posts_per_page": 200, 
                                   "allow_extra_requests": True,
                                   "sharers": True},
                          page_limit=None, extra_info=True, timeout=60,
                          start_url=start_url, request_url_callback=handle_pagination_url)

        for i, post in enumerate(posts):
            save_post()
            if (i+1) % 50 == 0:
                print(f"----- account: {c} changing -----")
                break

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
neon-ninjacommented, Jul 31, 2022

You can, but if you do that, when you request the page on which that post resides again you’d see posts you’d already seen

0reactions
neon-ninjacommented, Aug 2, 2022

yeah

Read more comments on GitHub >

github_iconTop Results From Across the Web

window.requestIdleCallback() - Web APIs | MDN
The window.requestIdleCallback() method queues a function to be called during a browser's idle periods. This enables developers to perform ...
Read more >
Using requestIdleCallback - Chrome Developers
requestIdleCallback is new performance API for scheduling work when the browser is idle.
Read more >
requestIdleCallback() - W3C
This document defines an API that web page authors can use to cooperatively schedule background tasks such that they do not introduce delays...
Read more >
requestIdleCallback | Can I use... Support tables for ... - CanIUse
API allowing the execution of JavaScript to be queued to run in idle browser time, either at the end of a frame or...
Read more >
PixelsCommander/requestIdleCallback-polyfill - GitHub
requestIdleCallback is a new browser API which allows to execute code when browser is idle. This is crucial for creating smooth animations and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found