npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cross-link-ai

v0.4.0

Published

Find cross-links between two sitemaps

Downloads

3

Readme

cross-link-ai

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.

Features

  • Fetch and parse sitemaps
  • Extract main content from web pages
  • Analyze content using AI to identify keywords and titles
    • Uses gpt-4o-mini model from ai Vercel SDK
  • Compare content across different websites to find linking opportunities

Prerequisites

Usage

To start the linking opportunities process, use the following command:

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]

Example

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.

Options

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

Scripts

  • yarn start: Run the application
  • yarn build: Build the project using webpack
  • yarn dev: Run the application in watch mode
  • yarn test:watch: Run tests in watch mode
  • yarn format: Format code using Prettier

Project Structure

  • src/: Source code
    • main.ts: Entry point of the application
    • start/: Main logic for the linking opportunities process
    • helper.ts: Utility functions

Dependencies

Key dependencies include:

  • @ai-sdk/anthropic and @ai-sdk/openai: AI SDKs for content analysis
  • cheerio: HTML parsing
  • commander: CLI interface
  • sitemap-links-ts: Sitemap parsing
  • zod: Schema validation

For a full list of dependencies, refer to the package.json file.

Development

Installation

  1. Clone the repository:

    git clone https://github.com/dxheroes/cross-link-ai
    cd cross-link-ai
  2. Install dependencies:

    yarn install
    # or
    npm install
  3. Create .env file with OPENAI_API_KEY. See .env.example for more info.

  4. Start the development server:

    yarn dev
    # or
    npm run dev
  5. Format code before committing:

    yarn format
    # or
    npm run format

Building

To build the project for production:

yarn build
# or
npm run build

The output will be in the dist/ directory.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some Amazing Feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.

Author

Prokop Simek [email protected]