<commit_before>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 25 14:28:52 2016

@author: adrian
"""

import wikipedia, argparse

parser = argparse.ArgumentParser()
parser.add_argument("-n","--name",dest="name")
parser.add_argument("-d", "--depth",dest="depth")
argumento = parser.parse_args()
wikipedia.set_lang("fr")
options = wikipedia.search(argumento.name)
print options
for i in range(int(argumento.depth)):
    print wikipedia.page(options[i]).content
<commit_msg>added request json parse<commit_after>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 25 14:28:52 2016

@author: adrian
"""

import wikipedia, argparse, json

parser = argparse.ArgumentParser()
parser.add_argument("-n","--name",dest="name")
argumento = parser.parse_args()
archivo = open(argumento.name)
archivo = archivo.read()
links = json.loads(archivo)
wikipedia.set_lang("fr")
options = wikipedia.search(links[0])
print options
for i in range(int(links[1])):
    print wikipedia.page(options[i]).content

{'fraction_non_alphanumeric': 0.171875, 'fraction_numerical': 0.029296875, 'mean_word_length': 5.612903225806452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6092916', 'n_tokens_mistral': 371, 'n_tokens_neox': 344, 'n_words': 76}