-
-
Notifications
You must be signed in to change notification settings - Fork 0
Iridescent Ivies #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Iridescent Ivies #17
Changes from all commits
fa06cb6
78cab9a
60a4853
63da9b8
a1212ac
1ff603a
9f6a220
a2c2bc8
bcacb08
a675095
3df61a9
7a6691c
36d4a03
e893104
93e71ea
d660c75
0c57e63
37346f9
90a6911
2442055
74d6b10
7b4d345
c11ee42
fd03e06
7c799ed
2cbe07a
ce6a40b
6c4c27a
bb1f2ff
97f7316
b47e4f4
80336b6
31a9a52
5d1ef58
ecd677c
39a2256
f45db16
7741779
ef869d8
6d4549e
2173896
3b2eb07
ed10e20
0160b57
e03c273
2fce7c4
17a1988
113ca45
c6e1884
a714dfa
58b218e
a0558a0
bab0da2
4d4783d
ab34bd9
0a8f157
d65263d
4eb45b8
4d9990f
6015188
4d782c3
65a5d86
2b6f1ff
fe4928d
1726066
cfd7b08
be33db4
d55e8b8
522678c
2499e60
63367fc
5f1cb7a
fa01055
561a440
5c2645e
cc99ceb
b7a78bf
cc1420a
2a6d9e9
3590597
ff36baf
925ddce
59c1465
fba4ed2
b8c0431
57fdd1e
92e9cfd
efe2b2b
834b23d
98b3d3b
f4d4350
4c065fa
2aa28cf
226419d
52b7f8b
3eb8406
58f461b
f854e0a
a814a19
c3c7bb8
d0b871c
9cfbb21
55b3ee8
e1f88fa
b7294bf
74aa20b
814b373
13dc8aa
08f963b
2af23db
974129b
fca25bc
8da23eb
3f995ae
418896c
1c35970
988fbc7
0110c33
f2626bf
5471d15
aa71dc5
27e51c6
78432d8
3051e1e
ab84803
d4ea78f
ba628e4
7262711
5e239c4
184d34e
923bb6d
95e50ca
69f1326
d32ff85
09ff220
7142cf8
d812018
93c11a5
88554d8
e07a158
e3d78ae
7a6405b
b8f440d
9257b73
d4a0539
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # GitHub Action workflow enforcing our code style. | ||
|
|
||
| name: Lint | ||
|
|
||
| # Trigger the workflow on both push (to the main repository, on the main branch) | ||
| # and pull requests (against the main repository, but from any repo, from any branch). | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| # Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit. | ||
| # It is useful for pull requests coming from the main repository since both triggers will match. | ||
| concurrency: lint-${{ github.sha }} | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| # The Python version your project uses. Feel free to change this if required. | ||
| PYTHON_VERSION: "3.12" | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ env.PYTHON_VERSION }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
|
||
| - name: Run pre-commit hooks | ||
| uses: pre-commit/action@v3.0.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Files generated by the interpreter | ||
| __pycache__/ | ||
| *.py[cod] | ||
|
|
||
| # Environment specific | ||
| .venv | ||
| venv | ||
| .env | ||
| env | ||
|
|
||
| # Unittest reports | ||
| .coverage* | ||
|
|
||
| # Logs | ||
| *.log | ||
|
|
||
| # PyEnv version selector | ||
| .python-version | ||
|
|
||
| # Built objects | ||
| *.so | ||
| dist/ | ||
| build/ | ||
| uv.lock | ||
| # IDEs | ||
| # PyCharm | ||
| .idea/ | ||
| # VSCode | ||
| .vscode/ | ||
| # MacOS | ||
| .DS_Store | ||
| src/sql_bsky.egg-info/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| args: [--markdown-linebreak-ext=md] | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.12.2 | ||
| hooks: | ||
| - id: ruff-check | ||
| - id: ruff-format | ||
|
|
||
| - repo: https://github.com/astral-sh/uv-pre-commit | ||
| rev: 0.8.8 | ||
| hooks: | ||
| - id: pip-compile | ||
| args: [ | ||
| "--universal", | ||
| "--python-version=3.12", | ||
| "pyproject.toml", | ||
| "--group=dev", | ||
| "-o", | ||
| "requirements.txt" | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Copyright 2021 Iridescent Ivies | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| ## The Social Query Language (SQL-BSky) | ||
|
|
||
| [](https://python.org) | ||
| [](https://bsky.app) | ||
| [](LICENSE.txt) | ||
| []() | ||
|
|
||
| A retro terminal-style SQL interface for querying the BlueSky social network. Experience social media through the lens of structured query language with authentic CRT visual effects. | ||
|
|
||
|  | ||
|
|
||
| ## Features | ||
|
|
||
| - **Dual Authentication**: Full BlueSky login or anonymous "stealth mode" | ||
| - **Public API Access**: Query public content without authentication | ||
| - **ASCII Art Images**: View embedded images as beautiful ASCII art | ||
| - **Real-time Validation**: Live SQL syntax checking as you type | ||
| - **Retro CRT Interface**: Authentic 1980s terminal experience with visual effects | ||
| - **Fast Performance**: Optimized queries with scrolling support | ||
| - **Easter Eggs**: Hidden surprises for the adventurous | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Installation | ||
|
|
||
| 1. Clone the repository: | ||
| ```bash | ||
| git clone git@github.com:A5rocks/code-jam-12.git | ||
|
|
||
| # move to the dir | ||
| cd code-jam-12 | ||
| ``` | ||
| 2. Start the development server: | ||
| ```bash | ||
| python3 dev.py | ||
| ``` | ||
|
|
||
| 3. That's it! Open your browser to: [http://localhost:8000](http://localhost:8000) | ||
|
|
||
| ### First Steps | ||
|
|
||
| 1. **Choose Authentication Mode**: | ||
| - **Authenticated**: Login with BlueSky credentials for full access | ||
| - **Stealth Mode**: Browse public content anonymously | ||
|
|
||
| > [!NOTE] | ||
| > If the page is slow, try disabling the CRT effect at this point. | ||
|
|
||
| 2. **Try Your First Query**: | ||
| ```sql | ||
| SELECT * FROM tables | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| 3. **Explore Public Profiles**: | ||
| ```sql | ||
| SELECT * FROM profile WHERE actor = 'bsky.app' | ||
| ``` | ||
|
|
||
| ## Query Reference | ||
|
|
||
| ### Available Tables | ||
|
|
||
| | Table | Description | Auth Required | Parameters | | ||
| |-------|-------------|---------------|------------| | ||
| | `tables` | List all available tables | No | None | | ||
| | `profile` | User profile information | No | `actor` (optional) | | ||
| | `feed` | Posts from a specific user | No | `author` (required) | | ||
| | `timeline` | Your personal timeline | Yes | None | | ||
| | `suggestions` | Suggested users to follow | No | None | | ||
| | `suggested_feed` | Recommended feeds | No | None | | ||
| | `followers` | User's followers | No | `actor` (required) | | ||
| | `following` | Who user follows | No | `actor` (required) | | ||
| | `mutuals` | Mutual connections | No | `actor` (required) | | ||
| | `likes` | User's liked posts | Yes | `actor` (required) | | ||
|
|
||
| ### Example Queries | ||
|
|
||
| ```sql | ||
| SELECT * FROM feed WHERE author='bsky.app' | ||
| ``` | ||
| - This will get all fields from all posts from the author's feed | ||
|
|
||
| ```sql | ||
| SELECT description FROM followers WHERE author='bsky.app' | ||
| ``` | ||
| - This will get the bio of all followers of the author | ||
|
|
||
| ```sql | ||
| SELECT * FROM tables | ||
| ``` | ||
| - This will get all available table names | ||
|
|
||
| ## Known Issues | ||
|
|
||
| > [!WARNING] | ||
| > Please be aware of these current limitations before using the application. | ||
|
|
||
| > [!NOTE] | ||
| > Queries to non-existent tables or fields will return empty rows instead of proper error messages. | ||
|
|
||
| **Example:** | ||
| ```sql | ||
| -- Both of these return empty rows (same behavior) | ||
| SELECT likes FROM feed WHERE author = "bsky.app" | ||
| SELECT apples FROM feed WHERE author = "bsky.app" | ||
| ``` | ||
|
|
||
| ### KeyError in Feed Processing | ||
| > [!IMPORTANT] | ||
| > There's a known KeyError where the system looks for `"feeds"` but should be looking for `"feed"`. This is a human error we discovered after the Code Jam programming time had ended, so we weren't able to fix it, but we're aware of the issue and it may cause some like-table-related queries to fail unexpectedly. | ||
|
|
||
| ##### Table `likes` Not Functional | ||
| > [!CAUTION] | ||
| > The `likes` table is currently broken and behaves like a non-existent table. This is due to the KeyError | ||
| ## Team - Iridescent Ivies | ||
|
|
||
| - **A5rocks** - [GitHub](https://github.com/A5rocks) (Team Leader) | ||
| - **TheHeretic** - [GitHub](https://github.com/DannyTheHeretic) | ||
| - **Walkercito** - [GitHub](https://github.com/Walkercito) | ||
| - **Joshdtbx** - [GitHub](https://github.com/giplgwm) | ||
| - **Mimic** - [GitHub](https://github.com/Drakariboo) | ||
|
|
||
| ## License | ||
|
|
||
| This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details. | ||
|
|
||
| --- | ||
|
|
||
| **Thank you for exploring our project!!** |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good simple entrypoint script, makes it very convenient to run. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import http.server | ||
| import os | ||
| import socketserver | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| # use src as start point | ||
| src_dir = Path(__file__).parent / "src" | ||
| if src_dir.exists(): | ||
| os.chdir(src_dir) | ||
| print(f"[*] Serving from: {src_dir.absolute()}") | ||
| else: | ||
| print("[-] src/ dir not found") | ||
| sys.exit(1) | ||
|
|
||
| PORT = 8000 | ||
| Handler = http.server.SimpleHTTPRequestHandler | ||
|
|
||
| try: | ||
| with socketserver.TCPServer(("", PORT), Handler) as httpd: | ||
| print(f"[*] Server running at: http://localhost:{PORT}") | ||
| print(f"[*] Open: http://localhost:{PORT}/") | ||
| print("[-] Press Ctrl+C to stop") | ||
| httpd.serve_forever() | ||
| except KeyboardInterrupt: | ||
| print("\nServer stopped") | ||
| except OSError as e: | ||
| print(f"[-] Error: {e}") | ||
| print("[-] Try a different port: python dev.py --port 8001") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not super important, but seems like specifying the port wasn't implemented? |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,54 @@ | ||||||||||||||||||||||||||||
| [project] | ||||||||||||||||||||||||||||
| name = "sql-bsky" | ||||||||||||||||||||||||||||
| description = "Social query language" | ||||||||||||||||||||||||||||
| version = "0.1.0" | ||||||||||||||||||||||||||||
| readme = "README.md" | ||||||||||||||||||||||||||||
| requires-python = ">=3.12" | ||||||||||||||||||||||||||||
| dependencies = [ | ||||||||||||||||||||||||||||
| "ascii-magic>=2.3.0", | ||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| [dependency-groups] | ||||||||||||||||||||||||||||
| dev = [ | ||||||||||||||||||||||||||||
| "pre-commit~=4.2.0", | ||||||||||||||||||||||||||||
| "ruff~=0.12.2", | ||||||||||||||||||||||||||||
| "pytest", | ||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+15
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's good to include these here for type checking in the IDE.
Suggested change
|
||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| [tool.ruff] | ||||||||||||||||||||||||||||
| line-length = 119 | ||||||||||||||||||||||||||||
| target-version = "py312" | ||||||||||||||||||||||||||||
| fix = true | ||||||||||||||||||||||||||||
| src = ["src"] | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| [tool.ruff.lint] | ||||||||||||||||||||||||||||
| # Enable all linting rules. | ||||||||||||||||||||||||||||
| select = ["ALL"] | ||||||||||||||||||||||||||||
| # Ignore some of the most obnoxious linting errors. | ||||||||||||||||||||||||||||
| ignore = [ | ||||||||||||||||||||||||||||
| # Missing docstrings. | ||||||||||||||||||||||||||||
| "D100", | ||||||||||||||||||||||||||||
| "D104", | ||||||||||||||||||||||||||||
| "D105", | ||||||||||||||||||||||||||||
| "D106", | ||||||||||||||||||||||||||||
| "D107", | ||||||||||||||||||||||||||||
| # Docstring whitespace. | ||||||||||||||||||||||||||||
| "D203", | ||||||||||||||||||||||||||||
| "D213", | ||||||||||||||||||||||||||||
| # Docstring punctuation. | ||||||||||||||||||||||||||||
| "D415", | ||||||||||||||||||||||||||||
| # Docstring quotes. | ||||||||||||||||||||||||||||
| "D301", | ||||||||||||||||||||||||||||
| # Builtins. | ||||||||||||||||||||||||||||
| "A", | ||||||||||||||||||||||||||||
| # Print statements. | ||||||||||||||||||||||||||||
| "T20", | ||||||||||||||||||||||||||||
| # TODOs. | ||||||||||||||||||||||||||||
| "TD002", | ||||||||||||||||||||||||||||
| "TD003", | ||||||||||||||||||||||||||||
| "FIX", | ||||||||||||||||||||||||||||
| # Conflicts with ruff format. | ||||||||||||||||||||||||||||
| "COM812", | ||||||||||||||||||||||||||||
| # Asserts are good, actually. | ||||||||||||||||||||||||||||
| "S101", | ||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # This file was autogenerated by uv via the following command: | ||
| # uv pip compile --universal --python-version=3.12 pyproject.toml --group=dev -o requirements.txt | ||
| ascii-magic==2.3.0 | ||
| # via sql-bsky (pyproject.toml) | ||
| cfgv==3.4.0 | ||
| # via pre-commit | ||
| colorama==0.4.6 | ||
| # via | ||
| # ascii-magic | ||
| # pytest | ||
| distlib==0.4.0 | ||
| # via virtualenv | ||
| filelock==3.18.0 | ||
| # via virtualenv | ||
| identify==2.6.12 | ||
| # via pre-commit | ||
| iniconfig==2.1.0 | ||
| # via pytest | ||
| nodeenv==1.9.1 | ||
| # via pre-commit | ||
| packaging==25.0 | ||
| # via pytest | ||
| pillow==11.3.0 | ||
| # via ascii-magic | ||
| platformdirs==4.3.8 | ||
| # via virtualenv | ||
| pluggy==1.6.0 | ||
| # via pytest | ||
| pre-commit==4.2.0 | ||
| # via sql-bsky (pyproject.toml:dev) | ||
| pygments==2.19.2 | ||
| # via pytest | ||
| pytest==8.4.1 | ||
| # via sql-bsky (pyproject.toml:dev) | ||
| pyyaml==6.0.2 | ||
| # via pre-commit | ||
| ruff==0.12.8 | ||
| # via sql-bsky (pyproject.toml:dev) | ||
| virtualenv==20.33.1 | ||
| # via pre-commit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # The main portion of fetching and recieving from Bsky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)