Comments (7)
Yeah, or a more generic --newer-than N
.
from mastodon-archive.
from mastodon-archive.
Maybe a simple —more option would be a good solution?
Agreed.
Or perhaps we could add an option saying that we actually only care about the hashtags we recently used (half a year?).
That would be a nice extra. Something like --report-recent-weeks N
?
from mastodon-archive.
Solved in 3e8afb6.
from mastodon-archive.
Hmm, not enterily solved: there isn't yet an option to include boosts in the tags. Feel free to apply the diff below (already tested):
diff --git a/mastodon_archive/__init__.py b/mastodon_archive/__init__.py
index 476e1f5..781dec5 100644
--- a/mastodon_archive/__init__.py
+++ b/mastodon_archive/__init__.py
@@ -106,9 +106,6 @@ if and only if they are in your archive''')
parser_content.add_argument("--top", dest='top',
metavar='N', type=int, default=10,
help='only print the top N tags')
- parser_content.add_argument("--include-boosts", dest='include_boosts', action='store_const',
- const=True, default=False,
- help='include boosts')
parser_content.add_argument("user",
help='your account, e.g. [email protected]')
parser_content.set_defaults(command=report.report)
diff --git a/mastodon_archive/report.py b/mastodon_archive/report.py
index e29f51b..990f2c5 100644
--- a/mastodon_archive/report.py
+++ b/mastodon_archive/report.py
@@ -39,14 +39,12 @@ def media(statuses):
return i
-def tags(statuses, include_boosts):
+def tags(statuses):
"""
Count all the hashtags in statuses
"""
count = {}
for item in statuses:
- if include_boosts and item["reblog"] is not None:
- item = item["reblog"]
for name in [tag["name"] for tag in item["tags"]]:
if name in count:
count[name] += 1
@@ -54,7 +52,7 @@ def tags(statuses, include_boosts):
count[name] = 1
return count
-def print_tags(statuses, max, include_boosts):
+def print_tags(statuses, max):
"""
Print hashtags used in statuses
"""
@@ -62,7 +60,7 @@ def print_tags(statuses, max, include_boosts):
print("All the hashtags:")
else:
print("Top " + str(max) + " hashtags:")
- count = tags(statuses, include_boosts)
+ count = tags(statuses)
most = sorted(count.keys(), key = lambda tag: -count[tag])
print(textwrap.fill(" ".join(
["#"+tag+"("+str(count[tag])+")" for tag in most[0:max]])))
@@ -108,7 +106,7 @@ def report(args):
print("Media:".ljust(20), str(media(statuses)).rjust(6))
print()
- print_tags(statuses, args.top, args.include_boosts)
+ print_tags(statuses, args.top)
if "statuses" in data and "favourites" in data:
print()
@@ -119,4 +117,4 @@ def report(args):
print("Media:".ljust(20), str(media(favourites)).rjust(6))
print()
- print_tags(favourites, args.top, args.include_boosts)
+ print_tags(favourites, args.top)
from mastodon-archive.
Do you want to do this via a pull request? That way, author and all will be correct without me having to fiddle with the command line too much.
from mastodon-archive.
Done by #26
from mastodon-archive.
Related Issues (20)
- Install "the Debian way" HOT 8
- getting mastodon-backup packaged (for Linux) HOT 19
- Generate tarball compatible to Mastodon's export HOT 5
- Specifying bookmarks or statuses with text search resets other specified collections HOT 2
- Feature: Backup / Export Filters HOT 8
- incremental runs of 'mastodon-archive' giving 404s on deleted mentions/replies on STDERR HOT 7
- Compress JSON HOT 8
- Consider making --with-followers and --with-following on by default? HOT 3
- Improve followers feature : consider more interactions HOT 4
- Report fails if no bookmark in archive (old archive) HOT 4
- Version check fails on Pleroma instance HOT 4
- HTML export to use cropped, centered images HOT 4
- HTML Export posts videos with a <img> tag HOT 6
- HTML Export pages should lazy load videos and images to be usable as static sites HOT 14
- Add pagination numbers in html exports
- TypeError: 'NoneType' object is not subscriptable HOT 8
- Backup other account's public posts HOT 1
- Don't burst the API rate limiting HOT 1
- Archiving context HOT 3
- Not an issue, just saying thanks :) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mastodon-archive.