Skip to content

pa4uslf/codex-automation-scripts

Repository files navigation

Codex Automation Scripts

Small Python utilities for two recurring workflows:

  • Exporting and organizing X/Twitter bookmarks
  • Checking whether GitHub fork policy files drift from upstream

Included scripts

  • check_fork_policy_files.py Compare LICENSE, COPYING, NOTICE, and README between a fork and its upstream repository.
  • export_twitter_bookmarks.py Export bookmarks from the authenticated X/Twitter account into a local archive.
  • sync_twitter_bookmarks.py Incrementally sync new bookmarks into the same archive.
  • organize_twitter_bookmarks.py Build a browsable local library from an export snapshot.
  • clip_twitter_bookmarks_to_obsidian.py macOS Safari automation helper for clipping bookmark pages into Obsidian with manual confirmation.
  • twitter_bookmarks_common.py Shared helpers for the bookmark scripts.

Requirements

  • Python 3.11+
  • For bookmark export/sync:
    • twitter-cli installed in the same Python environment
    • a valid authenticated X/Twitter session
  • For clip_twitter_bookmarks_to_obsidian.py:
    • macOS
    • Safari
    • Obsidian Web Clipper
    • Safari permission: Allow JavaScript from Apple Events
    • Accessibility permission for the terminal if you use quick or popup modes
  • For check_fork_policy_files.py:
    • GitHub API access
    • recommended: gh auth login

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

If you prefer uv:

uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

Environment variables

  • TWITTER_BOOKMARKS_ROOT Default root for bookmark exports. Defaults to ~/twitter_bookmarks.
  • OBSIDIAN_CLIP_DIR Default Obsidian target directory for the clipper helper. Defaults to ~/Obsidian/twitter_bookmarks.
  • GITHUB_TOKEN or GH_TOKEN Optional GitHub token for higher API rate limits in check_fork_policy_files.py.

Examples

Export all bookmarks:

python3 export_twitter_bookmarks.py

Incrementally sync bookmarks:

python3 sync_twitter_bookmarks.py

Build the local bookmark library:

python3 organize_twitter_bookmarks.py

Check fork policy file drift for a GitHub account:

python3 check_fork_policy_files.py --user your-github-handle --pause-seconds 0.1

Clip one specific X/Twitter bookmark into Obsidian:

python3 clip_twitter_bookmarks_to_obsidian.py \
  --clip-mode pause \
  --tab-mode reuse \
  --only-url 'https://x.com/example/status/1234567890'

Notes

  • These scripts are practical utilities, not a polished product.
  • Some scripts depend on external tools and local permissions by design.
  • Bookmark clipping is intentionally semi-automated: the pause mode is the safest workflow.

License

This repository is licensed under Apache-2.0. See LICENSE.

Third-party dependencies and attributions are listed in THIRD_PARTY_NOTICES.md.

About

Python automation scripts for X/Twitter bookmark export, Obsidian clipping, and GitHub fork policy drift checks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages