(link_header)
| 41 | |
| 42 | |
| 43 | def next_cursor(link_header): |
| 44 | if not link_header: |
| 45 | return None |
| 46 | for part in link_header.split(","): |
| 47 | if 'rel="next"' in part and 'results="true"' in part: |
| 48 | match = re.search(r'cursor="([^"]+)"', part) |
| 49 | if match: |
| 50 | return match.group(1) |
| 51 | return None |
| 52 | |
| 53 | |
| 54 | def request_json(url, token, retries=1): |