Skip to content

Instantly share code, notes, and snippets.

@PotcFdk
Last active February 28, 2016 20:16
Show Gist options
  • Select an option

  • Save PotcFdk/e26129503797e6843a1b to your computer and use it in GitHub Desktop.

Select an option

Save PotcFdk/e26129503797e6843a1b to your computer and use it in GitHub Desktop.

Revisions

  1. PotcFdk revised this gist Feb 28, 2016. 1 changed file with 12 additions and 8 deletions.
    20 changes: 12 additions & 8 deletions ipfs-pics-spider.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,14 @@
    while [ true ]; do
    id=$(curl -sI https://ipfs.pics/random | grep Location | sed 's/^Location.*\/\/ipfs\.pics\/\([^#]*\).*$/\1/')
    echo -n " - "
    if grep -Fxq "$id" ipfs-pics-ids.txt; then
    echo ".. $id"
    else
    echo -n "++ "
    echo "$id" | tee -a ipfs-pics-ids.txt
    fi
    while read line; do
    id=$(echo "$line" | grep Location | sed 's/^Location.*\/\/ipfs\.pics\/\([^#]*\).*$/\1/g')
    if [ -n "$id" ]; then
    echo -n " - "
    if grep -Fxq "$id" ipfs-pics-ids.txt; then
    echo ".. $id"
    else
    echo -n "++ "
    echo "$id" | tee -a ipfs-pics-ids.txt
    fi
    fi
    done < <( curl -sI $(printf 'https://ipfs.pics/random %.0s' {1..15}) )
    done
  2. PotcFdk revised this gist Feb 28, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions ipfs-pics-spider.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    while [ true ]; do
    id=$(curl -sI https://ipfs.pics/random | grep Location | sed 's/^Location.*\/\/ipfs\.pics\/\([^#]*\).*$/\1/')
    echo -n " - "
    if grep -Fxq "$id" ipfs-pics-ids.txt; then
    echo "(DUP) $id"
    echo ".. $id"
    else
    echo -n "(ADD) "
    echo -n "++ "
    echo "$id" | tee -a ipfs-pics-ids.txt
    fi
    done
  3. PotcFdk revised this gist Feb 28, 2016. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion ipfs-pics-spider.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    while [ true ]; do
    id=$(curl -sI https://ipfs.pics/random | grep Location | sed 's/^Location.*\/\/ipfs\.pics\/\([^#]*\).*$/\1/')
    done
    if grep -Fxq "$id" ipfs-pics-ids.txt; then
    echo "(DUP) $id"
    else
    echo -n "(ADD) "
    echo "$id" | tee -a ipfs-pics-ids.txt
    fi
    done
  4. PotcFdk revised this gist Feb 28, 2016. 1 changed file with 0 additions and 0 deletions.
    Empty file modified ipfs-pics-spider.sh
    100644 → 100755
    Empty file.
  5. PotcFdk created this gist Feb 28, 2016.
    3 changes: 3 additions & 0 deletions ipfs-pics-spider.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    while [ true ]; do
    id=$(curl -sI https://ipfs.pics/random | grep Location | sed 's/^Location.*\/\/ipfs\.pics\/\([^#]*\).*$/\1/')
    done