Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- TEMP=`mktemp`
- ( curl -s "http://www.geldvoorelkaar.nl/geld-investeren/projecten.aspx?orderby=7&page=1" && curl -s "http://www.geldvoorelkaar.nl/geld-investeren/projecten.aspx?orderby=7&page=2") | grep -o 'LeningIdLabel.>[0-9]*' | egrep -o '[0-9]+' | sort > $TEMP
- KNOWNFILE=/tmp/knownids.txt
- ADDRS=/tmp/addrs.txt
- # create addrs.txt and add 1 mail address per line
- while read num; do
- if grep -q $num $KNOWNFILE; then
- continue
- else
- curl -s "http://www.geldvoorelkaar.nl/geld-investeren/projecten/project.aspx?id=$num" > /tmp/$num
- NAAM=`cat /tmp/$num | grep -o 'ProjectNaamLabel.>[a-zA-Z ]*' | cut -d ">" -f 2`
- LEENDOEL=`cat /tmp/$num | grep -o 'LeendoelLabel.>[a-zA-Z ]*' | cut -d ">" -f 2`
- BEDRAG=`cat /tmp/$num | grep -o 'BedragLabel.>[^\d]*' | cut -d ">" -f 2 | cut -d "<" -f 1 | cut -d " " -f 2`
- RENTE=`cat /tmp/$num | grep -o 'RenteLabel.>[^\d]*' | cut -d ">" -f 2 | cut -d "<" -f 1`
- LOOPTIJD=`cat /tmp/$num | grep -o 'LooptijdLabel.>[0-9a-zA-Z ]*' | cut -d ">" -f 2`
- CLASSIFICATIE=`cat /tmp/$num | grep -o 'ClassificatieLabel.*>[A-Z]*' | cut -d ">" -f 2 | cut -d "<" -f 1`
- GRAYDON=`cat /tmp/$num | grep -o 'GraydonRatingLabel.*>[A-Z]*' | cut -d ">" -f 2 | cut -d "<" -f 1`
- while read mailaddr; do
- echo "Nieuw project op geldvoorelkaar: http://www.geldvoorelkaar.nl/geld-investeren/projecten/project.aspx?id=$num
- Naam: $NAAM
- Leendoel: $LEENDOEL
- Bedrag: $BEDRAG euro
- Rente: " $RENTE"
- Looptijd: $LOOPTIJD
- Classsificatie: $CLASSIFICATIE
- Graydon rating: $GRAYDON
- done < $ADDRS
- echo $num >> $KNOWNFILE
- fi
- done < $TEMP
Advertisement
Add Comment
Please, Sign In to add comment