mirror of
https://github.com/raynormast/fake-firehose.git
synced 2024-12-22 07:43:10 +00:00
Cleaned up some unneeded files.
This commit is contained in:
parent
2cc0d91ca4
commit
046839eba5
3 changed files with 11 additions and 73 deletions
|
@ -1,27 +0,0 @@
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
|
|
||||||
{
|
|
||||||
"name": "Ubuntu",
|
|
||||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
|
||||||
"image": "mcr.microsoft.com/devcontainers/base:focal",
|
|
||||||
"features": {
|
|
||||||
"ghcr.io/devcontainers/features/git:1": {},
|
|
||||||
"ghcr.io/devcontainers/features/github-cli:1": {},
|
|
||||||
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
|
||||||
// "features": {},
|
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
|
||||||
// "forwardPorts": [],
|
|
||||||
|
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
|
||||||
// "postCreateCommand": "uname -a",
|
|
||||||
|
|
||||||
// Configure tool-specific properties.
|
|
||||||
// "customizations": {},
|
|
||||||
|
|
||||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
|
||||||
// "remoteUser": "root"
|
|
||||||
}
|
|
11
docker-compose.sample.yml
Normal file
11
docker-compose.sample.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
version: "3.9 "
|
||||||
|
|
||||||
|
services:
|
||||||
|
firehose-archive:
|
||||||
|
build: .
|
||||||
|
image: fakefirehose:latest
|
||||||
|
volumes:
|
||||||
|
- ../data:/data
|
||||||
|
- ./config:/config
|
||||||
|
restart: always
|
||||||
|
env_file: .env.production
|
|
@ -1,46 +0,0 @@
|
||||||
host=$1
|
|
||||||
type=$2
|
|
||||||
hashtag=$1
|
|
||||||
|
|
||||||
if [[ "$host" == "" ]]
|
|
||||||
then
|
|
||||||
echo "Empty host: $host"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
today=`date +"%Y%m%d"`
|
|
||||||
|
|
||||||
case "$type" in
|
|
||||||
"federated")
|
|
||||||
fetch="https://$host/api/v1/streaming/public";;
|
|
||||||
"local")
|
|
||||||
fetch="https://$host/api/v1/streaming/public?local=true";;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "Starting to stream $fetch in 5 seconds"
|
|
||||||
|
|
||||||
sleep 5s;
|
|
||||||
|
|
||||||
curl -X "GET" "$fetch" \
|
|
||||||
--no-progress-meter | \
|
|
||||||
tee -a "/data/$today.json" | \
|
|
||||||
grep url | \
|
|
||||||
sed 's/data://g' | \
|
|
||||||
|
|
||||||
while read -r line
|
|
||||||
do
|
|
||||||
|
|
||||||
if [[ $line == *"uri"* ]]
|
|
||||||
then
|
|
||||||
url=`echo $line | jq .url| sed 's/\"//g'`
|
|
||||||
uri=`echo $line | jq .uri| sed 's/\"//g'`
|
|
||||||
|
|
||||||
echo "STREAMING: $host $url"
|
|
||||||
echo $uri >> "/data/$today.uris.txt"
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
Loading…
Reference in a new issue