![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
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.
mcdonald-location-apiv2
Advanced tools
A Node.js library to programmatically find the nearest McDonald's locations and perform searches on the McDonald's site.
mcdonald-location-apiv2
is a Node.js package that provides an easy way to find McDonald's locations based on latitude and longitude. It supports finding the nearest location or retrieving a list of locations within a specified search radius. This API utilizes an unofficial McDonald's location API and offers additional functionality for filtering results. It also offers a feature to search the McDonald's site and fetch results, such as food items, articles, etc.
To install mcdonald-location-apiv2
, use npm:
npm i mcdonald-location-apiv2
This will download and install the package and all its dependencies in your project's node_modules directory.
After installation, you can use the package in your Node.js application to make API requests. Here is a basic example:
const mcdonaldsApi = require('mcdonald-location-apiv2');
// Example: Get the nearest McDonald's location
mcdonaldsApi.getNearestLocation(40.712776, -74.005974)
.then(location => console.log(location))
.catch(error => console.error(error));
// Example: Get a list of McDonald's locations within a 10km radius
mcdonaldsApi.getLocations(40.712776, -74.005974, 10)
.then(locations => console.log(locations))
.catch(error => console.error(error));
getNearestLocation(latitude, longitude)
Parameters:
latitude
: Latitude of the search location.longitude
: Longitude of the search location.Returns: A Promise that resolves to the nearest McDonald's location.
getLocations(latitude, longitude, radius, maxResults)
Parameters:
latitude
: Latitude of the search location.longitude
: Longitude of the search location.radius
: Optional. Search radius in kilometers. Defaults to 8.045 km.maxResults
: Optional. Maximum number of results to return. Defaults to 30.Returns: A Promise that resolves to an array of McDonald's locations within the specified radius.
This library includes a function, searchMcDonaldsSite
, that allows you to search the McDonald's website for specific content. You can specify a search query and an optional limit for the number of results returned.
searchMcDonaldsSite(searchText, resultLimit)
searchText
(String): The text string you want to search for on the McDonald's site.resultLimit
(Number, optional): The maximum number of search results to return. Defaults to 10 if not specified.resultLimit
.const { searchMcDonaldsSite } = require('your-package-name');
searchMcDonaldsSite('Big Mac', 5)
.then(results => {
console.log(results); // Returns up to 5 results
})
.catch(error => {
console.error(error);
});
FAQs
A Node.js library to programmatically find the nearest McDonald's locations and perform searches on the McDonald's site.
The npm package mcdonald-location-apiv2 receives a total of 2 weekly downloads. As such, mcdonald-location-apiv2 popularity was classified as not popular.
We found that mcdonald-location-apiv2 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.