=== Blurbwing ===
Contributors: loyaltyoverroyalty
Tags: social media, drafts, ai, rss, content
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Draft platform-tailored social posts from your topics' news, with WordPress AI, on a daily schedule. Review and copy from wp-admin.

== Description ==

Blurbwing reads the RSS feeds behind the topics you choose, and each day it drafts short, platform-tailored social posts about the most post-worthy items. Drafts land in wp-admin as a private post type where you review, edit and copy them. It writes commentary in the voice of a working developer sharing something interesting, not a brand account.

It does not post to any network. Version 1 ends at a polished draft with a copy button, and provides hooks so a publishing add-on can extend it.

**Built on the WordPress AI layer.** Blurbwing uses WordPress 7.0's native, provider-agnostic AI client. It stores no API keys and bundles no provider. You configure a provider once under Settings → Connectors (the official AI Provider for Anthropic, Google or OpenAI plugins), and Blurbwing expresses a model preference and accepts whatever answers.

**Reads only what publishers syndicate.** Sources are RSS feeds fetched with WordPress core, so there is no extra API key, no rate limit and no cost. The AI receives a headline, publisher, short summary and URL, and writes original commentary. Drafts never reproduce feed content, and every draft stores and shows its source URL.

**Costs are capped.** A daily token budget stops a run once the limit is reached, so a misconfigured schedule can never burn through your provider credits.

= Features =

* Topic presets (Web Development, WordPress, AI/ML, Design, Marketing, Startups) plus your own custom feeds.
* One draft per platform: LinkedIn, X, Instagram, Facebook, Threads, each within that platform's length and hashtag conventions.
* A ranking pass picks the most post-worthy items before spending tokens on drafts.
* A daily schedule at the time you choose, in your site's timezone, plus a Run now button.
* A per-link source, a live character count against the platform limit, a first-comment field and a card-text line in the editor.
* A run log with token usage and the model and provider that answered.

== Installation ==

1. Upload the `blurbwing` folder to `/wp-content/plugins/`, or install through Plugins → Add New.
2. Activate the plugin. It requires WordPress 7.0+ and PHP 8.1+.
3. Install and configure an AI provider under Settings → Connectors.
4. Open Blurbwing → Settings, choose topics, platforms, a run time and a daily token budget, and save.

== Frequently Asked Questions ==

= Does it store my API key? =

No. Keys live in Settings → Connectors and are resolved by WordPress core. Blurbwing never reads, stores, logs or displays a key.

= Will it reproduce articles from my feeds? =

No. The AI receives only a headline, publisher, short summary and URL, and is instructed to write original commentary without quoting more than a short phrase. Every draft links to its source.

= Nothing is being generated on schedule. Why? =

WP-Cron only fires on site traffic, so a very quiet site may run late. If `DISABLE_WP_CRON` is set, the Settings screen shows the system-cron command to use. You can always use the Run now button.

= Does it post to LinkedIn, X or the others? =

Not in version 1. It produces drafts you copy and post yourself. The hooks below let a separate add-on add direct publishing.

== Hooks for developers ==

`do_action( 'blurbwing_draft_approved', int $draft_id, string $platform )` fires when a draft is approved.

`apply_filters( 'blurbwing_draft_content', string $text, int $draft_id, string $platform )` filters the copy-ready text of a draft (its body plus the source URL).

`apply_filters( 'blurbwing_platform_profiles', array $profiles )` tunes the per-platform length, hashtag and tone profiles.

`apply_filters( 'blurbwing_prompt_template', string $template, string $key, array $context )` overrides any prompt template (`ranking_system`, `ranking_user`, `generation_system`, `generation_user`).

`apply_filters( 'blurbwing_topic_presets', array $presets )` adds or changes the curated topic feed bundles.

== External services ==

Blurbwing connects to two kinds of external service. Neither is contacted until an administrator has saved the plugin's settings, and nothing is sent from your visitors' browsers.

= 1. RSS feeds of the topics you select =

To find news to write about, your server downloads the public RSS feeds behind the topic presets you tick, plus any custom feed URLs you add. Requests are made with WordPress core's `fetch_feed()` during the daily scheduled run and when you press Run now. Feeds of topics you did not select are never requested.

Each request is a plain HTTP GET. It carries no content from your site. As with any HTTP request, the publisher sees your server's IP address and the standard WordPress user agent, which includes your site URL.

The bundled preset feeds (listed in `data/topic-feeds.json`) and the services behind them:

* Web Development: CSS-Tricks, `css-tricks.com`, operated by DigitalOcean — [terms](https://www.digitalocean.com/legal/terms-of-service-agreement), [privacy](https://www.digitalocean.com/legal/privacy-policy). web.dev, `web.dev`, operated by Google — [terms](https://policies.google.com/terms), [privacy](https://policies.google.com/privacy).
* WordPress: WordPress.org News and Make WordPress Core, `wordpress.org` and `make.wordpress.org` — [privacy](https://wordpress.org/about/privacy/).
* AI / ML: Hugging Face blog, `huggingface.co` — [terms](https://huggingface.co/terms-of-service), [privacy](https://huggingface.co/privacy).
* Design: Smashing Magazine, `www.smashingmagazine.com` — [privacy](https://www.smashingmagazine.com/privacy-policy/). A List Apart, `alistapart.com` — [copyright and terms](https://alistapart.com/about/copyright/), [privacy](https://alistapart.com/about/privacy-policy/).
* Marketing: HubSpot Marketing Blog, `blog.hubspot.com` — [terms](https://legal.hubspot.com/terms-of-service), [privacy](https://legal.hubspot.com/privacy-policy).
* Startups: TechCrunch, `techcrunch.com` — [terms](https://techcrunch.com/terms-of-service/), [privacy](https://techcrunch.com/privacy-policy/).

Custom feeds you add are requested the same way, and are subject to their own publishers' terms.

= 2. The AI provider you configure in WordPress =

Blurbwing contains no AI provider code, no HTTP client and no API key setting. It hands prompts to the AI client built into WordPress 7.0, and WordPress sends them to whichever provider you connected under Settings → Connectors. If no provider is connected, nothing is sent.

What is sent, on each scheduled run or Run now: for every candidate news item, its headline, publisher name, a summary excerpt of at most 500 characters and its URL, together with Blurbwing's writing instructions and the length and hashtag limits of the platforms you selected. No user data, visitor data or site content is included.

Which service receives it depends on the provider plugin you installed. The official ones are:

* Anthropic (Claude) — [terms](https://www.anthropic.com/legal/commercial-terms), [privacy](https://www.anthropic.com/legal/privacy).
* Google (Gemini) — [terms](https://ai.google.dev/gemini-api/terms), [privacy](https://policies.google.com/privacy).
* OpenAI — [terms](https://openai.com/policies/terms-of-use/), [privacy](https://openai.com/policies/privacy-policy/).

Any other provider you connect through WordPress is subject to its own terms.

== Privacy ==

Blurbwing sends a headline, publisher, short summary and URL to the AI provider you configured, to generate draft text. It stores drafts, their source URLs, and per-run token counts in your database. It does not track visitors and stores no personal data from your site's audience.

== Screenshots ==

1. The drafts list with platform, topic, source and state columns, New/Approved/Used views, and Approve/Reject/Copy actions.
2. Settings: topics, platforms, custom feeds, schedule, token budget, run log, export and delete-all-data.
3. The draft editor with the Blurbwing panel: source link, live character count, first comment and card text.

== Changelog ==

= 0.1.0 =
* First release: scheduled AI drafting from RSS topics, per-platform drafts, ranking pass, token budget, run log, editor sidebar, copy button, and developer hooks.
