Skip to content

Commit

Permalink
add option to specify file directory
Browse files Browse the repository at this point in the history
  • Loading branch information
FarisZR committed Dec 25, 2023
1 parent 38bee43 commit 430a582
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nitter/create_guest_account.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ new_entry=$(curl -s -XPOST 'https://api.twitter.com/1.1/onboarding/task.json' \
-d "{\"flow_token\":\"${flow_token}\",\"subtask_inputs\":[{\"open_link\":{\"link\":\"next_link\"},\"subtask_id\":\"NextTaskOpenLink\"}]}" | jq -c -r '.subtasks[0]|if(.open_account) then {oauth_token: .open_account.oauth_token, oauth_token_secret: .open_account.oauth_token_secret} else empty end')

# Define the path to your JSON file
json_file="/src/guest_accounts.json"
json_file="$1"

# Add the new entry to the JSON array in the specified file
if [[ -n "$new_entry" && "$new_entry" != "null" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion nitter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- /home/ubuntu/nitter/create_guest_account.sh:/create_guest_account.sh:ro
labels:
ofelia.job-local.create_guest_accounts.schedule: "@every 12h"
ofelia.job-local.create_guest_accounts.command: "apk add curl jq && sh /create_guest_account.sh"
ofelia.job-local.create_guest_accounts.command: "apk add curl jq && sh /create_guest_account.sh /src/guest_accounts.json"

redis:
image: redis:7-alpine@sha256:090276da2603db19b154602c374f505d94c10ea57e9749fc3e68e955284bf0fd
Expand Down

0 comments on commit 430a582

Please sign in to comment.