Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A package to generate Sitemaps from a URL. Also provides a CLI for non programmatical use.
pip install sitemapgen
git clone https://github.com/Nalin-Angrish/SitemapGen.git
cd
into the downloaded directory by cd SitemapGen
.python setup.py install
.sitemapgen --help
. This command will show you the description of the library and the available options for using the command.SitemapGen v0.9.9 - By Nalin Angrish.
A general utility script for generating site XML sitemaps.
Options:
--version | Show the tool version
--help | Show this message and exit.
--url <url> | Specify a website url to generate a sitemap from.
--out <path> | Specify an output file for the sitemap.
--disguise <url> | Specify a disguise URL for use in the sitemap. Useful when you are creating sitemap for a local website before hosting it.
When Running the command, you need to specify the '--url' and the '--out' parameters while the '--disguise' parameter is optional.
Also, running the command with --version or --help will lead to the suppression of other parameters.
sitemapgen --version
SitemapGen v0.9.9 - By Nalin Angrish.
sitemapgen --url <URL of website> --out <Path to output sitemap>
. The URL specified here should not be blocked by a firewall and should be a complete URL. For example: localhost
would not be valid and you would have to use http://localhost
. If the output file specified does not exists, then it will be created. You can specify the output path as either a relative path to the current working directory or even an absolute path.--url
would be specified as http://localhost:port
whereas, in the sitemap you might need to use a domain like http://www.example.com
. In such cases, you can provide another option to the command line arguments by adding:
--disguise http://www.example.com
. It is always prefered to use http
instead of https
to avoid any future issue with the SSL certificate installation. So, the tool will automatically use the http
versions of the sitesThe library provides a Generator
class that can be used to generate a sitemap of a given URL. This is an example of how to use the Generator
class:
from sitemapgen import Generator # Import the Generator class
generator = Generator(site="http://localhost", output="sitemap.xml", disguise="http://www.example.com") # Create a generator instance where:
# site = The site to generate a sitemap of. (required)
# output = The path of the output file. (required) If the sitemap is not be written to a file, just set it to an empty string.
# disguise = The url to disguise the sitemap for. (optional)
urls = generator.discover() # Discover all URLs possible from the "site" specified during initialization.
# This function returns the URLs discovered but it's return value can also be ignored if the urls don't matter
# (If they are ultimately going to be written to a file)
# Returns a list
sitemap = generator.genSitemap() # Generate a String sitemap from the URLs discovered before. Should only be used after calling generator.discover()
# This function returns the generated sitemap but it's return value can also be ignored if the sitemap is just to be written to a file.
# Returns a String
generator.write() # Write to the output file specified. No return value.
To read the code documentation, go here
FAQs
A package to generate Sitemaps from a URL. Also provides a CLI for non programmatical use.
We found that sitemapgen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.