Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Took me a few minutes:

    // generate a key at https://www.bing.com/indexnow/getstarted
    const key = 'REPLACE_ME';

    export const submitUrlsToIndexNow = async (urls: string[]) => {
      await fetch('https://api.indexnow.org/IndexNow', {
        body: JSON.stringify({
          host: 'pillser.com',
          key,
          keyLocation: `https://pillser.com/${key}.txt`,
          urlList: urls,
        }),
        headers: {
          'Content-Type': 'application/json',
        },
        method: 'POST',
      });
    };

I now just auto submit when updates to products are published.

Thanks!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: