Last active
September 3, 2025 08:22
-
-
Save mujdat/514405a2a87c670474b5a5e3a276cb2e to your computer and use it in GitHub Desktop.
Duden Artikel Suche
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
| #!/bin/bash | |
| # Required parameters: | |
| # @raycast.schemaVersion 1 | |
| # @raycast.title Der Die Das | |
| # @raycast.mode fullOutput | |
| # Optional parameters: | |
| # @raycast.icon 📚 | |
| # @raycast.packageName Duden Artikel Suche | |
| # @raycast.argument1 { "type": "text", "placeholder": "Wort" } | |
| WORD=$(echo "$1" | awk '{print toupper(substr($0,1,1)) substr($0,2)}') | |
| URL="https://www.duden.de/rechtschreibung/${WORD// /%20}" | |
| ARTIKEL=$(curl -s "$URL" | awk -F'<span class="lemma__determiner">' '{if (NF>1) print $2}' | awk -F'</span>' '{print $1}' | head -n 1) | |
| if [ -n "$ARTIKEL" ]; then | |
| # Replace any <i>...</i> tags in the artikel with a slash | |
| echo "$ARTIKEL" | sed 's/<i>[^<]*<\/i>/\//g' | |
| else | |
| echo "Kein Artikel gefunden für: $WORD" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment