GithubHelp home page GithubHelp logo

mrandall101 / cartographer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from audiusproject/cartographer

0.0 0.0 0.0 736 KB

πŸ—Ί Audius sitemap generator

Home Page: https://audius.co/sitemaps/index.xml

License: Other

JavaScript 100.00%

cartographer's Introduction

audius.co sitemap generator


Run

The Cartographer sitemap generator is a node script that runs and is stateful on the presence of a local /sitemaps directory.

Given the existence of sitemaps in the sitemaps/ directory and the sitemaps/latest.yml config, Cartographer will crawl an Audius discovery provider, indexing new entries into the /sitemaps folder, which can then be persisted and served.

Example usage:

# Pull the staging sitemaps down
npm run pull:staging

# Run Cartographer
#  count: maximum number of each tracks, collections, and users fetch
npm run start:staging -- --count=1000

# Sync your changes to staging
npm run sync:staging

The same series of commands can be run with :production instead of staging.

Be careful when doing that!

You can also wipe your local sitemaps/ folder with

npm run reset

Notes

Cartographer also generates a sitemap (defaults.xml) which contains static routes for https://audius.co. New urls can be added in defaults.yml.

In Cartographer's current form, it only crawls forward and doesn't re-index things it has already re-indexed. To reindex the entirety of audius, reset and regenerate the entire sitemap.

CI

The sitemap generator runs in circleci every hour with --count=1000

That config can be found in ./circleci/config.yml

Deployment

The sitemap generator outputs the following directory structure

sitemaps
β”‚   index.xml
|   defaults.xml // Static routes
|
└───tracks
β”‚   β”‚   index.xml
β”‚   β”‚   1.xml  // Max 50K entries
|   |   2.xml
|   |   ...
└───collections
β”‚   β”‚   index.xml
β”‚   β”‚   1.xml
|   |   2.xml
|   |   ...
└───users
β”‚   β”‚   index.xml
β”‚   β”‚   1.xml
|   |   2.xml
|   |   ...

Depending on the crawler, the root index.xml file may not be able to be provided (as nested indexes aren't supported) and robots.txt files should list each index file for tracks, collections, and users as well as the defaults.xml file.

Updating SEOs

Note: This feature is incomplete

You may want to try and force update google.

npm run update:google

which will run a script that sends API requires to google to recrawl sitemaps

In order to run this, you need to make a service account here and set two env vars:


GOOGLE_APPLICATION_CREDENTIALS=<path to credentials.json>
GCLOUD_PROJECT=<the project you set up>

cartographer's People

Contributors

raymondjacobson avatar jowlee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.