diff --git a/components/alttextify/README.md b/components/alttextify/README.md new file mode 100644 index 0000000000000..271dcfd5c5bf4 --- /dev/null +++ b/components/alttextify/README.md @@ -0,0 +1,15 @@ +# Overview +AltTextify offers an AI-powered API that automatically generates alternative text (alt text) for images—playing a critical role in improving website accessibility and search engine optimization (SEO). It enables effortless creation of meaningful, descriptive, and keyword-rich alt text that aligns with ADA and WCAG standards. With AltTextify, you can automate alt text generation across websites, blogs, and online stores. In Pipedream, you can set up workflows that trigger on events, send images to the AltTextify API, and apply the returned alt text to your content systems—enhancing both compliance and search visibility without manual effort. + +# Example Use Cases +- **Effortless Alt Text for E-commerce Products**: Streamline your product content strategy with AltTextify. When a new image is uploaded to a Dropbox folder, Pipedream triggers a workflow that sends the image to AltTextify. The generated, SEO-friendly alt text is then automatically applied to the product in Shopify, WooCommerce, Magento or any other e-commerce platform—no manual tagging required. + +- **Smarter Blog Accessibility with Every Draft**: Ensure your blog posts are not just compelling—but compliant. As soon as a draft is created in WordPress, Pipedream can route embedded images to AltTextify. Within seconds, alt text is returned and added to the post, enhancing accessibility and aligning with ADA and WCAG standards before publication. + +- **AI-Assisted CMS Migration**: Migrating content from an old CMS (e.g., Joomla) to a new one (like WordPress or Strapi)? During migration, use Pipedream to detect missing or outdated image alt text. Send image URLs to AltTextify for automated generation and update metadata before importing—ensuring accessibility and SEO hygiene from day one. + +- **Alt Text Auditing & Enrichment**: Review and enrich existing image alt text across a large media library.Use Pipedream to crawl your existing CMS or S3 bucket, compare stored alt text, and pass low-quality or empty alt attributes to AltTextify for enhancement. Ideal for large publishers or digital libraries. + +- **Automated SEO optimizations for Static Sites**: Give your GitHub Pages site an organic search edge. On every new commit, Pipedream detects image changes, routes them through AltTextify, and injects relevant, keyword-optimized alt text into your HTML or Markdown. It's a hands-free upgrade to your site's SEO and accessibility—baked right into your development workflow. + + diff --git a/components/alttextify/actions/generate-alt-text/generate-alt-text.mjs b/components/alttextify/actions/generate-alt-text/generate-alt-text.mjs new file mode 100644 index 0000000000000..1d045b7d42739 --- /dev/null +++ b/components/alttextify/actions/generate-alt-text/generate-alt-text.mjs @@ -0,0 +1,70 @@ +import alttextify from "../../alttextify.app.mjs"; +import { LANGUAGE_LIST } from "../../common/constants.mjs"; + +export default { + name: "Generate Alt Text", + key: "alttextify-generate-alt-text", + description: "Generates a descriptive alt text for a given image. [See the documentation](https://apidoc.alttextify.net/#api-Image-UploadImageURL)", + version: "0.0.2", + type: "action", + props: { + alttextify, + image: { + type: "string", + label: "Image URL", + description: + "Provide a publicly accessible image URL in JPEG, PNG, GIF, WEBP, or BMP format.", + optional: false, + }, + lang: { + type: "string", + label: "The language for the generated alt text.", + description: "Provide a language code for the alt text output. Defaults to English (en). Accepts ISO 639-1 codes such as pt (Portuguese), de (German), etc.", + options: LANGUAGE_LIST, + default: "en", + optional: true, + }, + keywords: { + type: "string", + label: "SEO Keywords", + description: "List of keywords/phrases for SEO optimized alt text. Only one or two will be used per alt text, but all are considered. Keywords must be in English, even for alt text in other languages.", + default: "", + optional: true, + }, + product_name: { + type: "string", + label: "Product Name [Ecommerce]", + description: "Product name to be included in the final Alt Text.", + default: "", + optional: true, + }, + brand_name: { + type: "string", + label: "Brand Name [Ecommerce]", + description: "Brand name to be included in the final Alt Text.", + default: "", + optional: true, + } + }, + async run({ $ }) { + const response = await this.alttextify.generateAltText({ + $, + data: { + image: this.image, + keywords: this.keywords, + lang: this.lang, + ecommerce: { + product:{ + name: this.product_name, + brand: this.brand_name, + } + }, + async: false + }, + }); + console.log(response); + + $.export("$summary", "Alt text generated successfully"); + return response; + }, +}; diff --git a/components/alttextify/alttextify.app.mjs b/components/alttextify/alttextify.app.mjs index a171b942a7232..f1961aaff05c5 100644 --- a/components/alttextify/alttextify.app.mjs +++ b/components/alttextify/alttextify.app.mjs @@ -1,11 +1,34 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "alttextify", propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.alttextify.net/api/v1"; }, + async _makeRequest({ + $ = this, + path, + headers, + ...otherOpts + }) { + return axios($, { + ...otherOpts, + url: this._baseUrl() + path, + headers: { + ...headers, + "Authorization": `Bearer ${this.$auth.api_key}` + }, + }); + }, + async generateAltText(args) { + return this._makeRequest({ + path: "/image/url", + method: "POST", + ...args, + }); + }, }, }; \ No newline at end of file diff --git a/components/alttextify/common/constants.mjs b/components/alttextify/common/constants.mjs new file mode 100644 index 0000000000000..e011832ca49b0 --- /dev/null +++ b/components/alttextify/common/constants.mjs @@ -0,0 +1,538 @@ +export const LANGUAGE_LIST = [ + { + label: "Afrikaans", + value: "af", + }, + { + label: "Albanian", + value: "sq", + }, + { + label: "Amharic", + value: "am", + }, + { + label: "Arabic", + value: "ar", + }, + { + label: "Armenian", + value: "hy", + }, + { + label: "Assamese", + value: "as", + }, + { + label: "Aymara", + value: "ay", + }, + { + label: "Azerbaijani", + value: "az", + }, + { + label: "Bambara", + value: "bm", + }, + { + label: "Basque", + value: "eu", + }, + { + label: "Belarusian", + value: "be", + }, + { + label: "Bengali", + value: "bn", + }, + { + label: "Bhojpuri", + value: "bho", + }, + { + label: "Bosnian", + value: "bs", + }, + { + label: "Bulgarian", + value: "bg", + }, + { + label: "Catalan", + value: "ca", + }, + { + label: "Cebuano", + value: "ceb", + }, + { + label: "Chinese (Traditional)", + value: "zh-TW", + }, + { + label: "Chinese (Simplified)", + value: "zh-CN", + }, + { + label: "Corsican", + value: "co", + }, + { + label: "Croatian", + value: "hr", + }, + { + label: "Czech", + value: "cs", + }, + { + label: "Danish", + value: "da", + }, + { + label: "Dhivehi", + value: "dv", + }, + { + label: "Dutch", + value: "nl", + }, + { + label: "Dogri", + value: "doi", + }, + { + label: "English", + value: "en", + }, + { + label: "Esperanto", + value: "eo", + }, + { + label: "Estonian", + value: "et", + }, + { + label: "Ewe", + value: "ee", + }, + { + label: "Filipino (Tagalog)", + value: "fil", + }, + { + label: "Finnish", + value: "fi", + }, + { + label: "French", + value: "fr", + }, + { + label: "Frisian", + value: "fy", + }, + { + label: "Galician", + value: "gl", + }, + { + label: "Georgian", + value: "ka", + }, + { + label: "German", + value: "de", + }, + { + label: "Greek", + value: "el", + }, + { + label: "Guarani", + value: "gn", + }, + { + label: "Gujarati", + value: "gu", + }, + { + label: "Haitian Creole", + value: "ht", + }, + { + label: "Hausa", + value: "ha", + }, + { + label: "Hawaiian", + value: "haw", + }, + { + label: "Hebrew", + value: "he", + }, + { + label: "Hindi", + value: "hi", + }, + { + label: "Hmong", + value: "hmn", + }, + { + label: "Hungarian", + value: "hu", + }, + { + label: "Icelandic", + value: "is", + }, + { + label: "Igbo", + value: "ig", + }, + { + label: "Ilocano", + value: "ilo", + }, + { + label: "Indonesian", + value: "id", + }, + { + label: "Irish", + value: "ga", + }, + { + label: "Italian", + value: "it", + }, + { + label: "Japanese", + value: "ja", + }, + { + label: "Javanese", + value: "jv", + }, + { + label: "Kannada", + value: "kn", + }, + { + label: "Kazakh", + value: "kk", + }, + { + label: "Khmer", + value: "km", + }, + { + label: "Kinyarwanda", + value: "rw", + }, + { + label: "Konkani", + value: "gom", + }, + { + label: "Korean", + value: "ko", + }, + { + label: "Krio", + value: "kri", + }, + { + label: "Kurdish", + value: "ku", + }, + { + label: "Kurdish (Sorani)", + value: "ckb", + }, + { + label: "Kyrgyz", + value: "ky", + }, + { + label: "Lao", + value: "lo", + }, + { + label: "Latin", + value: "la", + }, + { + label: "Latvian", + value: "lv", + }, + { + label: "Lingala", + value: "ln", + }, + { + label: "Lithuanian", + value: "lt", + }, + { + label: "Luganda", + value: "lg", + }, + { + label: "Luxembourgish", + value: "lb", + }, + { + label: "Macedonian", + value: "mk", + }, + { + label: "Maithili", + value: "mai", + }, + { + label: "Malagasy", + value: "mg", + }, + { + label: "Malay", + value: "ms", + }, + { + label: "Malayalam", + value: "ml", + }, + { + label: "Maltese", + value: "mt", + }, + { + label: "Maori", + value: "mi", + }, + { + label: "Marathi", + value: "mr", + }, + { + label: "Meiteilon (Manipuri)", + value: "mni-Mtei", + }, + { + label: "Mizo", + value: "lus", + }, + { + label: "Mongolian", + value: "mn", + }, + { + label: "Myanmar (Burmese)", + value: "my", + }, + { + label: "Nepali", + value: "ne", + }, + { + label: "Norwegian", + value: "no", + }, + { + label: "Nyanja (Chichewa)", + value: "ny", + }, + { + label: "Odia (Oriya)", + value: "or", + }, + { + label: "Oromo", + value: "om", + }, + { + label: "Pashto", + value: "ps", + }, + { + label: "Persian", + value: "fa", + }, + { + label: "Polish", + value: "pl", + }, + { + label: "Portuguese", + value: "pt", + }, + { + label: "Punjabi", + value: "pa", + }, + { + label: "Quechua", + value: "qu", + }, + { + label: "Romanian", + value: "ro", + }, + { + label: "Russian", + value: "ru", + }, + { + label: "Samoan", + value: "sm", + }, + { + label: "Sanskrit", + value: "sa", + }, + { + label: "ScotsGaelic", + value: "gd", + }, + { + label: "Sepedi", + value: "nso", + }, + { + label: "Serbian", + value: "sr", + }, + { + label: "Sesotho", + value: "st", + }, + { + label: "Shona", + value: "sn", + }, + { + label: "Sindhi", + value: "sd", + }, + { + label: "Sinhala (Sinhalese)", + value: "si", + }, + { + label: "Slovak", + value: "sk", + }, + { + label: "Slovenian", + value: "sl", + }, + { + label: "Somali", + value: "so", + }, + { + label: "Spanish", + value: "es", + }, + { + label: "Sundanese", + value: "su", + }, + { + label: "Swahili", + value: "sw", + }, + { + label: "Swedish", + value: "sv", + }, + { + label: "Tagalog (Filipino)", + value: "tl", + }, + { + label: "Tajik", + value: "tg", + }, + { + label: "Tamil", + value: "ta", + }, + { + label: "Tatar", + value: "tt", + }, + { + label: "Thai", + value: "th", + }, + { + label: "Telugu", + value: "te", + }, + { + label: "Tigrinya", + value: "ti", + }, + { + label: "Tsonga", + value: "ts", + }, + { + label: "Turkish", + value: "tr", + }, + { + label: "Turkmen", + value: "tk", + }, + { + label: "Twi (Akan)", + value: "ak", + }, + { + label: "Ukrainian", + value: "uk", + }, + { + label: "Urdu", + value: "ur", + }, + { + label: "Uyghur", + value: "ug", + }, + { + label: "Uzbek", + value: "uz", + }, + { + label: "Vietnamese", + value: "vi", + }, + { + label: "Welsh", + value: "cy", + }, + { + label: "Xhosa", + value: "xh", + }, + { + label: "Yiddish", + value: "yi", + }, + { + label: "Yoruba", + value: "yo", + }, + { + label: "Zulu", + value: "zu", + }, +]; diff --git a/components/alttextify/package.json b/components/alttextify/package.json index a250623577574..b5b22db7f8b18 100644 --- a/components/alttextify/package.json +++ b/components/alttextify/package.json @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^1.5.1" } } \ No newline at end of file