Skip to content
This repository has been archived by the owner on Mar 7, 2022. It is now read-only.

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
thehappydinoa committed Nov 16, 2018
1 parent f99f5d1 commit de96f59
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 24 deletions.
28 changes: 14 additions & 14 deletions README → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ Welcome to Canari. You might be wondering what all these files are about. Before
`canari create-profile` you needed to create a transform package and that's exactly what you did here! I've given you a
directory structure to use in the following manner:

* `src/TruePeopleSearch` directory is where all your stuff goes in terms of auxiliary modules that you may need for
your modules
* `src/TruePeopleSearch/transforms` directory is where all your transform modules should be placed. An example
`helloworld` transform is there for your viewing pleasure.
* `src/TruePeopleSearch/transforms/common` directory is where you can put some common code for your transforms like
result parsing, entities, etc.
* `src/TruePeopleSearch/transforms/common/entities.py` is where you define your custom entities. Take a look at the
examples provided if you want to play around with custom entities.
* `maltego/` is where you can store your Maltego entity exports.
* `src/TruePeopleSearch/resources/maltego` directory is where your `entities.mtz` and `*.machine` files can be
stored for auto install and uninstall.
* `src/TruePeopleSearch/resources/external` directory is where you can place non-Python transforms written in other
languages.
- `src/TruePeopleSearch` directory is where all your stuff goes in terms of auxiliary modules that you may need for
your modules
- `src/TruePeopleSearch/transforms` directory is where all your transform modules should be placed. An example
`helloworld` transform is there for your viewing pleasure.
- `src/TruePeopleSearch/transforms/common` directory is where you can put some common code for your transforms like
result parsing, entities, etc.
- `src/TruePeopleSearch/transforms/common/entities.py` is where you define your custom entities. Take a look at the
examples provided if you want to play around with custom entities.
- `maltego/` is where you can store your Maltego entity exports.
- `src/TruePeopleSearch/resources/maltego` directory is where your `entities.mtz` and `*.machine` files can be
stored for auto install and uninstall.
- `src/TruePeopleSearch/resources/external` directory is where you can place non-Python transforms written in other
languages.

If you're going to add a new transform in the transforms directory, remember to update the `__all__` variable in
`src/TruePeopleSearch/transforms/__init__.py`. Otherwise, `canari install-package` won't attempt to install the
Expand Down Expand Up @@ -47,4 +47,4 @@ D:This was pointless!

Cool right? If you have any further questions don't hesitate to drop us a line;)

Have fun!
Have fun!
2 changes: 0 additions & 2 deletions entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@
:keyword str properties_name: Name (``properties.name``)
:keyword str properties_city: City (``properties.city``)
:keyword int properties_age: Age (``properties.age``)


2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setup(
name='TruePeopleSearch',
author='thehappydinoa',
version='1.0.1',
version='1.0.2',
author_email='[email protected]',
description='Uses True People Search to gather info',
license='GPLv3',
Expand Down
8 changes: 7 additions & 1 deletion src/TruePeopleSearch/transforms/associates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from canari.maltego.transform import Transform

from .common.entities import TruePerson
from .common.scrapper import scrape

__author__ = 'thehappydinoa'
__copyright__ = 'Copyright 2018, TruePeopleSearch Project'
Expand All @@ -22,7 +23,12 @@ def do_transform(self, request, response, config):
person = request.entity
fields = person.fields

soup = scrape(fields.get("properties.url"))
if fields.get("properties.url"):
url = fields.get("properties.url").value
else:
url = None

soup = scrape(url)

if soup:
associates = soup.find_all(
Expand Down
1 change: 0 additions & 1 deletion src/TruePeopleSearch/transforms/common/scrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def random_user_agent():
return random.choice(user_agent_list)



def scrape(url):
if not url:
return
Expand Down
7 changes: 6 additions & 1 deletion src/TruePeopleSearch/transforms/current_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def do_transform(self, request, response, config):
person = request.entity
fields = person.fields

soup = scrape(fields.get("properties.url"))
if fields.get("properties.url"):
url = fields.get("properties.url").value
else:
url = None

soup = scrape(url)

if soup:
addresses = soup.find_all(
Expand Down
9 changes: 8 additions & 1 deletion src/TruePeopleSearch/transforms/email_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from canari.maltego.transform import Transform

from .common.entities import TruePerson
from .common.scrapper import scrape

__author__ = 'thehappydinoa'
__copyright__ = 'Copyright 2018, TruePeopleSearch Project'
Expand All @@ -23,7 +24,13 @@ def do_transform(self, request, response, config):
person = request.entity
fields = person.fields

soup = scrape(fields.get("properties.url"))
if fields.get("properties.url"):
url = fields.get("properties.url").value
else:
url = None

soup = scrape(url)

if soup:
email_addresses = soup.find_all(attrs={"class": "__cf_email__"})
for email_address in email_addresses:
Expand Down
8 changes: 7 additions & 1 deletion src/TruePeopleSearch/transforms/phone_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from canari.maltego.transform import Transform

from .common.entities import TruePerson
from .common.scrapper import scrape

__author__ = 'thehappydinoa'
__copyright__ = 'Copyright 2018, TruePeopleSearch Project'
Expand All @@ -23,7 +24,12 @@ def do_transform(self, request, response, config):
person = request.entity
fields = person.fields

soup = scrape(fields.get("properties.url"))
if fields.get("properties.url"):
url = fields.get("properties.url").value
else:
url = None

soup = scrape(url)

if soup:
phone_numbers = soup.find_all(attrs={"data-link-to-more": "phone"})
Expand Down
8 changes: 7 additions & 1 deletion src/TruePeopleSearch/transforms/previous_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from canari.maltego.transform import Transform

from .common.entities import TruePerson
from .common.scrapper import scrape

__author__ = 'thehappydinoa'
__copyright__ = 'Copyright 2018, TruePeopleSearch Project'
Expand All @@ -23,7 +24,12 @@ def do_transform(self, request, response, config):
person = request.entity
fields = person.fields

soup = scrape(fields.get("properties.url"))
if fields.get("properties.url"):
url = fields.get("properties.url").value
else:
url = None

soup = scrape(url)

if soup:
addresses = soup.find_all(
Expand Down
8 changes: 7 additions & 1 deletion src/TruePeopleSearch/transforms/relatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from canari.maltego.transform import Transform

from .common.entities import TruePerson
from .common.scrapper import scrape

__author__ = 'thehappydinoa'
__copyright__ = 'Copyright 2018, TruePeopleSearch Project'
Expand All @@ -23,7 +24,12 @@ def do_transform(self, request, response, config):
person = request.entity
fields = person.fields

soup = scrape(fields.get("properties.url"))
if fields.get("properties.url"):
url = fields.get("properties.url").value
else:
url = None

soup = scrape(url)

if soup:
relatives = soup.find_all(attrs={"data-link-to-more": "relative"})
Expand Down

0 comments on commit de96f59

Please sign in to comment.