Find linking opportunities between two sitemaps using AI
This project is a CLI tool designed to find linking opportunities between websites using AI-powered content analysis.
- Fetch and parse sitemaps
- Extract main content from web pages
- Analyze content using AI to identify keywords and titles
- Uses
gpt-4o-mini
model fromai
Vercel SDK
- Uses
- Compare content across different websites to find linking opportunities
- Node.js (v20.15.0 or later)
- yarn or npm
- OpenAI API key (you can use OpenAI API Playground to get one)
To start the linking opportunities process, use the following command:
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY &&
npx cross-link-ai start -m [your-sitemap-url] -s [target-sitemap-url] -f [your-sitemap-filter] -g [target-sitemap-filter]
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY &&
npx cross-link-ai start -m https://dxheroes.io/sitemap.xml -s https://developerexperience.io/sitemap.xml --my-filter "/blog/" --sitemap-filter "articles/"
Replace [your-sitemap-url]
with the URL of your sitemap and [target-sitemap-url]
with the URL of the sitemap you want to compare against.
Usage: cross-link-ai start [options]
Start the intelligent linking opportunities process
Options:
-m, --my <url> Your Sitemap URL
-s, --sitemap <url> URL to the target sitemap file
-f, --my-filter <regex> Regex to filter paths for your sitemap
-g, --sitemap-filter <regex> Regex to filter paths for the other sitemap
-h, --help display help for command
yarn start
: Run the applicationyarn build
: Build the project using webpackyarn dev
: Run the application in watch modeyarn test:watch
: Run tests in watch modeyarn format
: Format code using Prettier
src/
: Source codemain.ts
: Entry point of the applicationstart/
: Main logic for the linking opportunities processhelper.ts
: Utility functions
Key dependencies include:
@ai-sdk/anthropic
and@ai-sdk/openai
: AI SDKs for content analysischeerio
: HTML parsingcommander
: CLI interfacesitemap-links-ts
: Sitemap parsingzod
: Schema validation
For a full list of dependencies, refer to the package.json
file.
-
Clone the repository:
git clone https://github.com/dxheroes/cross-link-ai cd cross-link-ai
-
Install dependencies:
yarn install # or npm install
-
Create
.env
file withOPENAI_API_KEY
. See.env.example
for more info. -
Start the development server:
yarn dev # or npm run dev
-
Format code before committing:
yarn format # or npm run format
To build the project for production:
yarn build
# or
npm run build
The output will be in the dist/
directory.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some Amazing Feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License.
Prokop Simek prokop.simek@dxheroes.io