Download outreach-agent/scraper/instagram.py from Org-Exp/tokenizer: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/datasets/Org-Exp/tokenizer/resolve/main/outreach-agent/scraper/instagram.py
- Command line
-
hf download hf://datasets/Org-Exp/tokenizer/outreach-agent/scraper/instagram.py
-
curl -L -o instagram.py https://huggingface.co/datasets/Org-Exp/tokenizer/resolve/main/outreach-agent/scraper/instagram.py
1.11 kB
| from typing import Any, Dict, Optional | |
| from apify_client import ApifyClient | |
| from .client import BaseClient | |
| class InstagramScraper(BaseClient): | |
| """Instagram scraper configured for a compatible Apify actor.""" | |
| actor_id = "shu8hvrXbJbY3Eb9W" | |
| def __init__( | |
| self, | |
| client: Optional[ApifyClient] = None, | |
| actor_id: Optional[str] = None, | |
| *, | |
| run_input: Optional[Dict[str, Any]] = None, | |
| ) -> None: | |
| default_run_input = { | |
| "resultsType": "posts", | |
| "directUrls": [ | |
| "https://www.instagram.com/explore/tags/ai/", | |
| "https://www.instagram.com/explore/tags/machinelearning/", | |
| "https://www.instagram.com/explore/tags/llm/" | |
| ], | |
| "resultsLimit": 100, | |
| "searchType": "hashtag", | |
| "searchLimit": 10, | |
| "addParentData": False, | |
| } | |
| super().__init__( | |
| client=client, | |
| actor_id=actor_id or self.actor_id, | |
| default_run_input=default_run_input, | |
| ) | |
| if run_input: | |
| self.default_run_input.update(run_input) | |