-
Notifications
You must be signed in to change notification settings - Fork 0
Add Figshare API authentication and rate limiting to fix 403 errors #5
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
Conversation
Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
|
@copilot I'm still hitting rate limits, add a configurable sleep after each request to the fig share API, set to a default of 1 second. In addition, in the workflow, make the --force-refresh optional, only to be used when the workflow is manually dispatched and manually enabled. Otherwise make use of the cache. |
- Add configurable rate_limit_delay parameter (default 1 second) to FigShare class - Add sleep after each API request to avoid rate limits - Add --rate-limit-delay CLI argument - Update workflow to only use --force-refresh when manually dispatched with force_refresh=true - By default, workflow now uses cache for all automated runs - Update README with rate limiting documentation and workflow behavior Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Done in commit e310467. Changes made:
The workflow will now respect rate limits and minimize API calls. To force a refresh, manually trigger the workflow and set |
…handling; add publication statistics generation script
…e directory before generating publication statistics
…t max_retries to 1
…he for output directory
…tion for GET/POST requests
…r improved cache retrieval
The workflow fails with 403 Forbidden when calling Figshare's
/articles/searchendpoint. The Python code supports token auth viaFIGSHARE_TOKENenv var, but the workflow doesn't pass it. Additionally, rate limiting issues can occur with authenticated requests.Changes
Workflow (
.github/workflows/figshare-processing.yaml)FIGSHARE_TOKENsecret as environment variable to Python scriptforce_refreshinput for workflow_dispatch (dropdown: true/false, default: false)--force-refreshwhen manually dispatched withforce_refresh=trueError Handling (
figshare.py)__handle_403_error()helper--rate-limit-delayCLI argument for customizationDocumentation
README.md: Setup instructions, token configuration, usage guide, rate limiting behavior, workflow behaviorFIGSHARE_API_RESEARCH.md: 403 error analysis, API authentication detailsIMPLEMENTATION_SUMMARY.md: Token setup walkthroughRequired Setup
Repository owner must add
FIGSHARE_TOKENGitHub secret:FIGSHARE_TOKENWithout the token, the workflow will log clear warnings and continue to fail with 403 errors on API calls.
Rate Limiting
--rate-limit-delayparameterWorkflow Behavior
Example
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.