Projects STRLCPY Maryam Commits d352bb9c
🤬
  • ■ ■ ■ ■ ■
    maryam/core/util/engines/google.py
    skipped 84 lines
    85 85   card_xpath_name = {
    86 86   'card': '//div[@id="wp-tabs-container"]',
    87 87   'card_content': './/div[@class="kno-rdesc"]',
    88  - 'card_info': './/div[@class="rVusze"]'
     88 + 'card_info': './/div[@class="rVusze"]||'
    89 89   }
    90 90   xpath = {
    91 91   card_xpath_name['card']: [
    skipped 27 lines
    119 119   xpath_results = parser.html_fromstring(xpath)
    120 120   xpath_results2 = parser.html_fromstring(xpath2)
    121 121   xpath_results3 = parser.html_fromstring(xpath3)
     122 + 
    122 123   output = {'content': '', 'info': []}
     124 + 
     125 + content = parser.html_fromstring('.//div[@class="kno-rdesc"]')
     126 + if content:
     127 + output['content'] = content[0].text_content()
     128 + if output['content'].startswith('Description'):
     129 + output['content'] = output['content'].replace('Description', '')
     130 + 
     131 + for i in parser.html_fromstring('.//div[@class="rVusze"]'):
     132 + if i.text_content():
     133 + output['info'].append(i.text_content().replace('\xa0', ' '))
     134 + 
    123 135   root = xpath_results[card_xpath_name['card']]
    124 136   root2 = xpath_results2[card_xpath_second['card']]
    125 137   root3 = xpath_results3[card_xpath_social['card']]
    126  - if root[card_xpath_name['card_content']]:
     138 + if root[card_xpath_name['card_content']] and output['content'] == '':
    127 139   output['content'] = root[card_xpath_name['card_content']][0].text_content()
    128 140   else:
    129 141   card_xpath_name = {
    skipped 9 lines
    139 151   }
    140 152   xpath_results = parser.html_fromstring(xpath)
    141 153   root = xpath_results[card_xpath_name['card']]
    142  - if root[card_xpath_name['card_content']]:
     154 + if root[card_xpath_name['card_content']] and output['content'] == '':
    143 155   output['content'] = root[card_xpath_name['card_content']][0].text_content()
    144  - else:
    145  - output['content'] = ''
    146 156   img = root2[card_xpath_second['card_img']]
    147 157   name = root2[card_xpath_second['card_name']]
    148 158   known_as = root2[card_xpath_second['card_known_as']]
    skipped 9 lines
    158 168   output['social'] = []
    159 169   for piece in social:
    160 170   output['social'].append(piece.get('href'))
     171 + output['info'] = list(set(output['info']))
    161 172   return output
    162 173   
    163 174   @property
    skipped 26 lines
  • ■ ■ ■ ■
    maryam/core/util/helpers/keywords.py
    skipped 39 lines
    40 40   self._zapmeta = 'https://www.zapmeta.com/suggest?q=<Q>'
    41 41   self._searx = 'https://searx.be/autocompleter?q=<Q>'
    42 42   self._peekier = {'url': 'https://search.peekier.com/suggestions', 'payload': {'q': '<Q>', 'region': ''}, 'method': 'POST'}
    43  - self._gigablast = 'http://gigablast.com/qs?rwp=0&lang=en&q=<Q>'
     43 + self._gigablast = 'https://gigablast.com/qs?rwp=0&lang=en&q=<Q>'
    44 44   
    45 45   def run_crawl(self):
    46 46   keys = {}
    skipped 47 lines
  • ■ ■ ■ ■ ■ ■
    maryam/modules/osint/famous_person.py
    skipped 20 lines
    21 21   'name': 'Famous Person Report',
    22 22   'author': 'Kaushik',
    23 23   'version': '0.1',
    24  - 'description': 'later',
    25  - 'required': ('$search', '$iris'),
     24 + 'description': 'Finding information about celebrities.',
    26 25   'sources': ('google', 'wikipedia', 'wikileaks', 'twitter', 'sanctionsearch'),
    27 26   'options': (
    28 27   ('name', '', False, 'Name', '-n', 'store', str),
    skipped 37 lines
    66 65   print()
    67 66   self.output(f"Searching For: {fullname}")
    68 67   
     68 + # Receives information from the first page of google search
    69 69   google_run = self.google(fullname, count=10)
    70 70   google_run.run_crawl()
    71 71   google_results = google_run.results
    72 72   card = google_run.google_card
     73 + 
    73 74   wiki = self.wikipedia(fullname, 5)
    74 75   wiki.run_crawl()
    75 76   links_with_title = wiki.links_with_title
    skipped 30 lines
    106 107   wiki_page = self.wikipedia(selected_pid, 1)
    107 108   wiki_extract = wiki_page.page()['extract']
    108 109   output['wikipedia'] = f"{selected_link} {selected_title}"
     110 + output['description_wiki'] = wiki_extract[:500] + '...'
    109 111   
    110  - if 'content' in card:
    111  - output['description'] = card['content'].replace('Description', 'Description: ')
    112  - else:
    113  - if have_we_wiki:
    114  - output['description'] = wiki_extract[:500]
     112 + if 'content' in card and card['content']:
     113 + output['description'] = card['content']
     114 + 
    115 115   if 'name' in card:
    116 116   output['name'] = card['name']
    117 117   else:
    skipped 90 lines
  • ■ ■ ■ ■
    setup.py
    skipped 19 lines
    20 20   
    21 21  setup(
    22 22   name='maryam',
    23  - version='2.5.1-0',
     23 + version='2.5.1-1',
    24 24   url='https://github.com/saeeddhqan/Maryam',
    25 25   author='Saeed Dehqan',
    26 26   author_email='[email protected]',
    skipped 32 lines
Please wait...
Page is in error, reload to recover