Open
Conversation
Owner
|
This all looks excellent. I hope to have some time to test this soon. |
Owner
|
Really good. A few issues. Currently requires python = ">=3.12" - my system has 3.10, can this be lowered? If I manual lower the version, it says
Manually installing gftools works. Can copying to the clipboard be default on? Even using -b doesn't seem to copy data to the clipboard. The HTML output could do with being minified. Seems to be lots of whitespace in there. (Not sure if that's a regression or whether I didn't update the GitHub copy). Converting Mastodon to JSON gives TypeError: a bytes-like object is required, not 'str' If no output directory is specified, what happens to the downloaded data? It seems to disappear. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quite a large refactor of the code to turn into a python package.
Main changes are:
Refactoring
src/tweet2embeddirectorypyproject.tomlfile to hold dependencies - so can now be installed, eg in a virtual environment (I've been using this to test out using uv). I've added selenium as an optional dependency as it has a bit of extra overheadCLI
python -m tweet2embed. You can then follow it with any number of tweet IDs, tweet URLs or mastodon URLs.-oor--outputflag - the options arehtml,imgorjson- you can specify more than one-s/--saveoption to specify the output directory for saved files-b/--clipboard/--no-clipboardoption can switch copy to clipboard on or off (this is obviously less useful for multiple tweets)-a/--archive/--no-archiveoption can switch off submission to archive.orgTemplating
src/tweet2embed/templates/tweet_to_html()function (and mastodon equivalent) uses the template. Ideally the get_card_html, get_media, etc would move to a template tooOthers
src/tweet2embed/utilsThe code that does the actual work is still 99.9% original - it may have been moved around a bit. Let me know what you think - I may have moved it too far from the "do one thing well" scripts that you created...