mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-30 20:48:36 +03:00
feat: cashtag func
This commit is contained in:
@@ -1830,6 +1830,23 @@ class TwitterHashtagScraper(TwitterSearchScraper):
|
|||||||
return cls._cli_construct(args, args.hashtag)
|
return cls._cli_construct(args, args.hashtag)
|
||||||
|
|
||||||
|
|
||||||
|
class TwitterCashtagScraper(TwitterSearchScraper):
|
||||||
|
name = 'twitter-cashtag'
|
||||||
|
|
||||||
|
def __init__(self, cashtag, **kwargs):
|
||||||
|
super().__init__(f'${cashtag}', **kwargs)
|
||||||
|
self._cashtag = cashtag
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _cli_setup_parser(cls, subparser):
|
||||||
|
subparser.add_argument('cashtag', type=snscrape.base.nonempty_string(
|
||||||
|
'cashtag'), help='A Twitter cashtag (without $)')
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _cli_from_args(cls, args):
|
||||||
|
return cls._cli_construct(args, args.cashtag)
|
||||||
|
|
||||||
|
|
||||||
class TwitterTweetScraperMode(enum.Enum):
|
class TwitterTweetScraperMode(enum.Enum):
|
||||||
SINGLE = 'single'
|
SINGLE = 'single'
|
||||||
SCROLL = 'scroll'
|
SCROLL = 'scroll'
|
||||||
|
|||||||
Reference in New Issue
Block a user