Hello,
I've created a simple bash script for insert nodes from blockchain.info to bitcoind.
#!/bin/bash
# Add nodes from blockchain.info to bitcoind
# Tested on bitcoin version 0.9.1
#run as Bitcoin user
#su -l Bitcoin -c "/home/addnode.sh" -s /bin/sh
clear
IFS=$'\n'
nodes=`curl -s http://blockchain.info/connected-nodes | egrep -o '([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)' | sort -u`
i=0
for node in $nodes; do
bitcoin=`bitcoind addnode $node add 2>&1`
if [ -z "$bitcoin" ]; then
((i++))
elif [ -n "`echo $bitcoin | grep -v 'error: {"code":-23,"message":"Error: Node already added"}'`" ]; then
echo "Unknown error: $bitcoin"
exit 1
fi
done
if [ "$i" -gt 0 ]; then
echo "Successfully added $i new nodes."
else
echo "There are no new nodes."
fi
Can be run from a cronjob (change path):
*/30 * * * * /home/addnode.sh > /dev/null
Here is source:
https://gist.github.com/emsit/98f13006afa2ff69328b