<commit_before>'''
# findnpeek.py
#
# brief: change to or create a folder named "findnpeek" in the working
#        directory for storing 2 log files. The main functionality is
#        to look for PDF files at the given URLs and opening them up
#        in the default browser, 5 PDF addresses at a time. The given
#        URLs and found addresses of PDF files are logged, each catagory
#        in its own text file.
#
# Author: <NAME>
#
# Contributors: none yet.
#
# *Note: I'll have to come back to this later, but the PDF addresses are
#        not fixed before logging them. This will have to be corrected.
#
'''

import sys
import os
import urllib2
import webbrowser
from HTMLParser import HTMLParser

filetype = ".pdf"                          # extension of filetype
pathname = 'findnpeek'                     # folder name

# this function will create a folder for itself if one doesn't exist in the running directory
def folderMaker():

        loop = 1

        # Allow user to change the folder name
        # pathname = raw_input('Folder name (for this run): ')
        # if (pathname == ''):
        #       pathname = 'findnpeek'

        fullpath = os.path.realpath(0) + '\\' + pathname

        while (loop <= 5):
                print "Looking for " + fullpath
<commit_msg>Update findnpeek.py Documention<commit_after>'''
# findnpeek.py
#
# brief: change to or create a folder named "findnpeek" in the working
#        directory for storing 2 log files. The main functionality is
#        to look for PDF files at the given URLs and opening them up
#        in the default browser, 5 PDF addresses at a time. The given
#        URLs and found addresses of PDF files are logged, each catagory
#        in its own text file.
#
# Author: <NAME>
#
# Contributors: none yet.
#
# *Heads-up[1]: urlFixer(str m, str n) requires more URL analysis techniques, since
#               it doesn't currently know if it has a full URL, or just a local
#               directory reference that's made in the HTML code of the webpage.
#               Current technique list:
#                 (1) ANDs the given URL, m, with the found URL, n. If the given
#                     URL is not a part of the found URL, then it concatenates m
#                     to the left (beginning) of n. This produces Bug[1].
#
# *Bug[1]:   urlFixer(str m, str n) does not know anything about the found URL,
#            n, and it just tries to see if the given URL, m, is a part of it.
#            So if a link to an external PDF file (hosted on a different domain) 
#            is found on the webpage at the given URL, then that perfectly good 
#            URL becomes bad, since m is not a part of n and, so, urlFixer() 
#            concatenates m to n anyway. As an example:
#
#               Given URL, m: http://cyberphit.net/
#               Found URL, n: http://homenetworkwarrior.com/Cyber_Phit_1.1.pdf
#               "Fixed URL" : http://cyberphit.net/http://homenetworkwarrior.com/Cyber_Phit_1.1.pdf
#
# *Bug[2]: I'll have to come back to this later, but the PDF addresses are
#          not fixed before logging them. This will have to be corrected.
#
'''

import sys
import os
import urllib2
import webbrowser
from HTMLParser import HTMLParser

filetype = ".pdf"                          # extension of filetype
pathname = 'findnpeek'                     # folder name

# this function will create a folder for itself if one doesn't exist in the running directory
def folderMaker():

        loop = 1

        # Allow user to change the folder name
        # pathname = raw_input('Folder name (for this run): ')
        # if (pathname == ''):
        #       pathname = 'findnpeek'

        fullpath = os.path.realpath(0) + '\\' + pathname

        while (loop <= 5):
                print "Looking for " + fullpath

{'fraction_non_alphanumeric': 0.07953950811093669, 'fraction_numerical': 0.005494505494505495, 'mean_word_length': 2.212605042016807, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3041224', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1060, 'n_words': 493}