{"id":34713865,"url":"https://github.com/robertdevore/deep-blue","last_synced_at":"2026-05-28T14:31:07.473Z","repository":{"id":291185234,"uuid":"922414509","full_name":"robertdevore/deep-blue","owner":"robertdevore","description":"Send articles written in markdown to DeepSeek for summaries which then get sent to your BlueSky account as posts 😎","archived":false,"fork":false,"pushed_at":"2025-01-26T07:19:35.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T07:04:37.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdevore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-26T06:08:10.000Z","updated_at":"2025-01-28T18:05:12.000Z","dependencies_parsed_at":"2025-05-03T00:01:59.646Z","dependency_job_id":"803afe25-53dc-4b58-8e2a-0473a80a29ad","html_url":"https://github.com/robertdevore/deep-blue","commit_stats":null,"previous_names":["robertdevore/deep-blue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robertdevore/deep-blue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fdeep-blue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fdeep-blue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fdeep-blue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fdeep-blue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdevore","download_url":"https://codeload.github.com/robertdevore/deep-blue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdevore%2Fdeep-blue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33613431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T00:52:49.504Z","updated_at":"2026-05-28T14:31:07.467Z","avatar_url":"https://github.com/robertdevore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Blue\nThis script automates the process of summarizing Markdown files into concise posts and publishing them to Bluesky. It integrates with the DeepSeek API to generate summaries and Bluesky's API for posting.\n\n## Features\n\n- **Markdown Integration**: Reads content from Markdown files in the specified folder.\n- **AI-Powered Summarization**: Uses DeepSeek API to generate concise summaries.\n- **Bluesky API Integration**: Authenticates and posts content to Bluesky.\n- **Grapheme Validation**: Ensures posts are within the 300-grapheme limit required by Bluesky.\n- **Error Handling**: Handles API failures and network issues gracefully.\n- **KeyboardInterrupt Safety**: Safely exits when interrupted.\n\n## Installation\n\n### Requirements\n\n- Python 3.7+\n- Dependencies listed in `requirements.txt`:\n    - `requests`\n    - `python-dotenv`\n    - `openai`\n\n### Setup\n\n1. **Clone the Repository**:\n    ```bash\n    git clone \u003crepository-url\u003e\n    cd \u003crepository-folder\u003e\n    ```\n\n2. **Install Dependencies**:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n3. **Create a `.env` File**: Add your API credentials to a `.env` file in the root directory:\n    ```makefile\n    BLUESKY_HANDLE=your-bluesky-handle\n    BLUESKY_APP_PASSWORD=your-bluesky-app-password\n    DEEPSEEK_API_KEY=your-deepseek-api-key\n    ```\n\n4. **Prepare Content**: Place your Markdown files in the `content-ai-1` folder (or modify the `CONTENT_FOLDER` variable in the script to point to your content folder).\n\n## Usage\n\nRun the script from the terminal:\n    ```bash\n    python3 deepBlue.py\n    ```\n\n### Example Workflow\n\n1. The script authenticates with Bluesky using your credentials.\n2. It reads Markdown files from the specified folder (`content` by default).\n3. For each file:\n    - The content is summarized using the DeepSeek API.\n    - The summary is validated to ensure it adheres to the 300-grapheme limit.\n    - The validated summary is posted to Bluesky.\n4. Success or failure for each file is logged to the terminal.\n\n## Script Breakdown\n\n### Functions\n\n1. **`authenticate_bluesky()`**:\n\n    - Authenticates with Bluesky and retrieves an access token and DID for posting.\n2. **`fetch_deepseek_summary(content)`**:\n\n    - Sends content to the DeepSeek API and retrieves a concise summary.\n3. **`truncate_to_graphemes(text, max_graphemes)`**:\n\n    - Ensures the text does not exceed the 300-grapheme limit.\n4. **`validate_and_post_to_bluesky(access_token, did, text)`**:\n\n    - Validates the summary and posts it to Bluesky.\n5. **`get_markdown_files(folder_path)`**:\n\n    - Fetches all Markdown files from the specified folder.\n6. **`read_markdown_file(filepath)`**:\n\n    - Reads the content of a Markdown file.\n7. **`main()`**:\n\n    - Orchestrates the entire process, from reading files to posting summaries.\n\n### Key Error Handling\n\n- **Missing API Credentials**: The script exits with an error message if any required credentials are missing.\n- **Grapheme Limit Enforcement**: Ensures summaries fit Bluesky's character limit by truncating gracefully.\n- **Interrupt Handling**: Safely exits when interrupted using `Ctrl+C`.\n\n## Customization\n\n- **Content Folder**: Modify the `CONTENT_FOLDER` variable to change the folder from which Markdown files are read.\n- **DeepSeek Prompt**: Adjust the `prompt` in the `fetch_deepseek_summary` function to tailor the AI-generated summaries.\n\n## Example Output\n\n**Terminal Log**:\n\n```plaintext\nBluesky authentication successful.\nProcessing file: content-ai-1/sample.md\nSummarizing content...\nDeepSeek summarization successful.\nPosting to Bluesky:\n🚀 Maximize ROI with AI-driven insights! 🚀  \nSeparate insights into actionable trends.  \n#AI\nResponse Status: 201\nPosted successfully: {'uri': '...', 'cid': '...'}\n```\n\n**Example Post**:\n\n```csharp\n🚀 Maximize ROI with AI-driven insights! 🚀  \nSeparate insights into actionable trends.  \n#AI\n```\n\n* * *\n\n## Troubleshooting\n\n1. **Authentication Errors**:\n\n    - Verify `BLUESKY_HANDLE` and `BLUESKY_APP_PASSWORD` in the `.env` file.\n    - Ensure your Bluesky account is active and the credentials are correct.\n2. **DeepSeek API Issues**:\n\n    - Check your `DEEPSEEK_API_KEY`.\n    - Confirm the DeepSeek service is available.\n3. **Invalid Post Length**:\n\n    - Ensure content is concise and adheres to the 300-grapheme limit.\n    - Adjust the prompt in the script if summaries are too verbose.\n\n## Future Enhancements\n\n- Support for posting images using Bluesky's blob upload API.\n- Logging to a file instead of printing to the terminal.\n- Support for additional post formatting (e.g., mentions, rich-text facets).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdevore%2Fdeep-blue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdevore%2Fdeep-blue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdevore%2Fdeep-blue/lists"}