Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Temporary Webhook Server with Ngrok Integration
This PR introduces a new
webhook startcommand toxurl, enabling users to quickly set up a temporary local server to receive and inspect X API webhook events. This is particularly useful for development and testing webhook integrations.Features Added:
Local Webhook Server (
xurl webhook start):Ngrok Integration:
NGROK_AUTHTOKENenvironment variable).Console Output Enhancements:
New Command-Line Options for
xurl webhook start:--port <number>(-p): Specifies the local port for the webhook server (ngrok will forward to this port, defaults to 8080).--output <filename>(-o): Appends the raw body of all incoming POST requests to the specified file.--quiet(-q): Reduces console verbosity for POST events. Only logs that an event was received, not the full body.--pretty(-P): If a POST request body is JSON and quiet mode is not enabled, it will be pretty-printed and colorized in the console for easier inspection.Documentation:
README.mddetailing the temporary webhook setup process, including how to start the server and register the ngrok URL with the X API.How to Use:
xurl auth oauth1 --consumer-key ... --consumer-secret ...xurl webhook start(Optionally use
-p,-o,-q,-Pflags)https://<unique-id>.ngrok-free.app/webhook) to register your webhook with the X API:xurl --auth app /2/webhooks -d '{"url": "https://<your-ngrok-url>/webhook"}' -X POSTThis feature streamlines the process of testing X API webhooks by handling the local server setup, ngrok tunneling, and CRC responses automatically.