Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def job(self):
colorama.init()
writer = StringWriter(self.options.filename)
def summary(result):
for content in result:
if not self.options.metadata_to_dict:
if self.options.verbose:
pprint(Fore.CYAN + content['date'] + Fore.RESET)
pprint(Fore.CYAN + Style.DIM + content['title'] + Style.RESET_ALL + Fore.RESET)
pprint(Fore.CYAN + Style.DIM * 2 + content['traffic'] + Style.RESET_ALL + Fore.RESET)
writer.write("@date:" + content['date'])
writer.write("@title:" + content['title'])
writer.write("@traffic:" + content['traffic'])
else:
output = '\t'.join([content['date'], content['title'], content['traffic']])
if self.options.verbose:
pprint(output)
writer.write(output)
def job(self):
colorama.init()
writer = StringWriter(self.options.filename)
def summary(result):
if not self.options.metadata_to_dict:
if self.options.verbose:
pprint(Fore.CYAN + result['title'] + Fore.RESET)
pprint(Fore.CYAN + Style.DIM + result['written_at'] + Style.RESET_ALL + Fore.RESET)
pprint(result['body'])
writer.write("@title:" + result['title'])
writer.write("@written_at:" + result['written_at'])
writer.write("@body:" + result['body'])
else:
if self.options.verbose:
pprint(result)
writer.write(result)
while (self.options.final_post_id > self._current_post_id) | self.options.forever:
type=int
)
parser.add_argument(
'-n', '--n_limits',
help="stop when this amount of trends are collected. 0 for forever",
default=10,
type=int
)
parser.add_argument(
'--filename',
help="filename to be saved.",
default="trends.txt"
)
self.options, _ = parser.parse_known_args()
self.writer = StringWriter(self.options.filename)
type=int
)
parser.add_argument(
'-n', '--n_limits',
help="stop when this amount of trends are collected. 0 for forever",
default=10,
type=int
)
parser.add_argument(
'--filename',
help="filename to be saved.",
default="trends.txt"
)
self.options, _ = parser.parse_known_args()
self.writer = StringWriter(self.options.filename)