-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5533e94
commit 33357fe
Showing
7 changed files
with
138 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
import csv | ||
import sys | ||
from tqdm import tqdm | ||
import time | ||
from minet.facebook import FacebookMobileScraper | ||
from minet.cli.console import console | ||
|
||
scraper = FacebookMobileScraper(cookie="firefox") | ||
|
||
USERS_URL = [ | ||
] | ||
USERS_URL = ["https://www.facebook.com/guillaume.plique.9/"] | ||
|
||
for url in USERS_URL: | ||
print(scraper.user_infos(url)) | ||
console.print(scraper.user_infos(url), highlight=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# ============================================================================= | ||
# Minet Facebook User Places Lived CLI Action | ||
# Minet Facebook User Infos CLI Action | ||
# ============================================================================= | ||
# | ||
# Logic of the `fb user-places-lived` action. | ||
# Logic of the `fb user-infos` action. | ||
# | ||
from minet.cli.utils import with_enricher_and_loading_bar | ||
from minet.cli.loading_bar import LoadingBar | ||
from minet.cli.facebook.utils import with_facebook_fatal_errors | ||
from minet.facebook import FacebookMobileScraper | ||
from minet.facebook.types import MobileFacebookUserInfo | ||
|
||
|
||
@with_facebook_fatal_errors | ||
@with_enricher_and_loading_bar( | ||
headers=MobileFacebookUserInfo, title="Finding user profile infos", unit="users" | ||
headers=MobileFacebookUserInfo, title="Scraping user infos", unit="users" | ||
) | ||
def action(cli_args, enricher, loading_bar): | ||
def action(cli_args, enricher, loading_bar: LoadingBar): | ||
scraper = FacebookMobileScraper(cli_args.cookie, throttle=cli_args.throttle) | ||
|
||
for i, row, user_url in enricher.enumerate_cells( | ||
cli_args.column, with_rows=True, start=1 | ||
): | ||
for row, user_url in enricher.cells(cli_args.column, with_rows=True): | ||
with loading_bar.step(): | ||
user_infos = scraper.user_infos(user_url) | ||
print(row) | ||
enricher.writerow(row, user_infos.as_csv_row() if user_infos is not None else None) | ||
enricher.writerow(row, user_infos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters