<commit_before>import pickle
from i2p import socket
from struct import *
import time
import random
import sys
from time import strftime, localtime
import shared

def getBootstrapListFromEepsite():
    print 'Getting some defaultKnownNodes from eepsite'
    try:
        dest = shared.config.get('bitmessagesettings', 'bootstrapeepsite')
    except: return []
    
    S = socket.socket('', socket.SOCK_STREAM)  
    S.connect(dest)
    S.send('GET /bootstrap.json HTTP/1.0\r\n\r\n')          # Send request
    f = S.makefile()                          # File object
    
    while True:                               # Read header
        line = f.readline().strip()           # Read a line
        if line == '': break                  # Content begins
    
    str = f.read()                            # Read file object
    S.close()
    import json
    return json.loads(str)                    # Load list from JSON and return

def createDefaultKnownNodes(appdata):
    ############## Stream 1 ################
    stream1 = {}
    #stream1[shared.Peer('<KEY>CK<KEY>')] = int(time.time())
    
    eepsite_list = getBootstrapListFromEepsite()<commit_msg>Fix close connection in getBootstrapListFromEepsite<commit_after>import pickle
from i2p import socket
from struct import *
import time
import random
import sys
from time import strftime, localtime
import shared

def getBootstrapListFromEepsite():
    print 'Getting some defaultKnownNodes from eepsite'
    try:
        dest = shared.config.get('bitmessagesettings', 'bootstrapeepsite')
    except: return []
    
    S = socket.socket('', socket.SOCK_STREAM)  
    S.connect(dest)
    S.send('GET /bootstrap.json HTTP/1.0\r\n\r\n')          # Send request
    f = S.makefile()                          # File object
    
    while True:                               # Read header
        line = f.readline().strip()           # Read a line
        if line == '': break                  # Content begins
    
    str = f.read()                            # Read file object
    f.close()                                 # Close file, connection
    S.close()

    import json
    return json.loads(str)                    # Load list from JSON and return

def createDefaultKnownNodes(appdata):
    ############## Stream 1 ################
    stream1 = {}
    #stream1[shared.Peer('<KEY>')] = int(time.time())
    
    eepsite_list = getBootstrapListFromEepsite()
{'fraction_non_alphanumeric': 0.11587628865979381, 'fraction_numerical': 0.004948453608247422, 'mean_word_length': 2.0024752475247523, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1326316', 'n_tokens_mistral': 690, 'n_tokens_neox': 664, 'n_words': 183}