From cbd05c2fa52a0b5b82c2b5caa7b564186f9579d9 Mon Sep 17 00:00:00 2001 From: Penelope Gwen / Pogmommy Date: Sun, 19 Feb 2023 18:14:33 -0700 Subject: [PATCH 1/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4682998..df544f8 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ node ./multi.js [-htqrpmbc] [-n tweetcount] [-d debuglevel] [-w timeout] [Example of single-user scraper](https://tech.lgbt/@pogmommy) -[Example of multi-user scraper](https://techhub.social/@twitterscraper) +[Example of multi-user scraper](https://techhub.social/@twitterscraper) (now inactive) ## How types of content are handled From efb9e15022bcf515357d2b1b7e05873275074117 Mon Sep 17 00:00:00 2001 From: Penelope Gwen / Pogmommy Date: Tue, 21 Feb 2023 10:50:48 -0700 Subject: [PATCH 2/4] Add files via upload --- macOS_loop.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 macOS_loop.sh diff --git a/macOS_loop.sh b/macOS_loop.sh new file mode 100644 index 0000000..b59f2ca --- /dev/null +++ b/macOS_loop.sh @@ -0,0 +1,12 @@ + +echo 'export PATH=$PATH:/usr/local/bin/chromedriver' >> ~/.zshenv +source ~/.zshenv +if [ `wc -l ./output/output.txt | awk '{print $1}'` -ge "500" ] +then + mv ./output/output.txt "./output/$(date +"%m-%d-%y-%h-%m-%s").txt" +fi +echo 'running script...' >> ./output/output.txt +/bin/date >> ./output/output.txt +/usr/local/bin/node ./TwitToMast.js -tqp -u pogmommy -n 10 >> ./output/output.txt +/usr/bin/pkill Chrome +/usr/bin/killall node From 2e8817f2e4d3efa08d69cd2db1acfd79cfb7a1c0 Mon Sep 17 00:00:00 2001 From: Penelope Gwen / Pogmommy Date: Tue, 21 Feb 2023 10:56:28 -0700 Subject: [PATCH 3/4] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df544f8..63fbadf 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,9 @@ node ./multi.js [-htqrpmbc] [-n tweetcount] [-d debuglevel] [-w timeout] **A.** TwitToMast doesn't run perpetually by default. You'll need to set it up yourself to run on a schedule. -- On macos, you can run the script every 10 minutes with the following command in an automator app set up to run at login. - - `zsh -c "cd /path/to/repository/TwitToMast && exec screen -DmS twittercrosspost zsh -c 'while true; do /path/to/node ./TwitToMast.js [username] [tweet count] [debug level] & sleep 600; done'"` +- on MacOS: `macOS_loop.sh` is an included shell script that will run TwitToMast repeatedly on a 10-minute interval. You will need to edit [arguments], [username], and [tweetcount] inside the script according to your use case. This script is provided as a proof-of-concept, there are likely more optimal ways of running TwitToMast on a loop. The shell script should log the output to a file, renaming the file if it exceeds 500 lines. It will also forcibly kill Chrome and Node in the case that for some reason they remain open after the script has finished. - You can connect to the created screen to monitor the output of the script with `screen -ls` and `screen -r [screenid]` -- Windows users, try [this](https://joshuatz.com/posts/2020/using-windows-task-scheduler-to-automate-nodejs-scripts/) +- On Windows: try [this](https://joshuatz.com/posts/2020/using-windows-task-scheduler-to-automate-nodejs-scripts/) - If you're on linux, you probably already know what you're doing **Q.** Doesn't bypassing Twitter's API violate their TOS? From 05871cb662586f6f8b38680e4c5d9435a660e999 Mon Sep 17 00:00:00 2001 From: Penelope Gwen / Pogmommy Date: Tue, 21 Feb 2023 10:56:37 -0700 Subject: [PATCH 4/4] Add files via upload --- macOS_loop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macOS_loop.sh b/macOS_loop.sh index b59f2ca..3a9931d 100644 --- a/macOS_loop.sh +++ b/macOS_loop.sh @@ -7,6 +7,6 @@ then fi echo 'running script...' >> ./output/output.txt /bin/date >> ./output/output.txt -/usr/local/bin/node ./TwitToMast.js -tqp -u pogmommy -n 10 >> ./output/output.txt +/usr/local/bin/node ./TwitToMast.js -[arguments] -u [username] -n [tweetcount] >> ./output/output.txt /usr/bin/pkill Chrome /usr/bin/killall node