Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

boston-food-trucks-info

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boston-food-trucks-info

Simple library to scrape data from the boston food trucks website

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

boston-food-trucks-info

Simple library to scrape data from the boston food trucks website

Installation

npm install --save boston-food-trucks-info

Usage

const { fetchCurrentPage, getFoodTruckSchedule } = require("boston-food-trucks-info");

fetchCurrentPage().then(page => {
  const chinaTradeBuilding = getFoodTruckSchedule(page, "China Trade Building");
  console.log(chinaTradeBuilding);
})

Sample Output

{
  "lunch": {
    "monday": [
      {
        "name": "Oath Pizza",
        "link": "http://oathpizza.com/"
      }
    ],
    "tuesday": [
      {
        "name": "Chef Leo's Kitchen"
      }
    ],
    "wednesday": [
      {
        "name": "Perros Paisas",
        "link": "https://www.facebook.com/Perros-Paisas-En-Boston-748803585293605/"
      }
    ],
    "thursday": [
      {
        "name": "IQ Cooking on Wheels",
        "link": "https://twitter.com/dragonrollgrill?lang=en"
      }
    ],
    "friday": [],
    "saturday": [],
    "sunday": []
  },
  "dinner": {
    "monday": [],
    "tuesday": [],
    "wednesday": [],
    "thursday": [],
    "friday": [],
    "saturday": [],
    "sunday": []
  }
}

API Reference

interface Page {
  /* This type is internal and should be treated as a blackbox */
}

interface VisitingFoodTruck {
  name: string;
  link?: string;
}

interface FoodTruckSchedule {
  lunch: {
    monday: VisitingFoodTruck[];
    tuesday: VisitingFoodTruck[];
    wednesday: VisitingFoodTruck[];
    thursday: VisitingFoodTruck[];
    friday: VisitingFoodTruck[];
    saturday: VisitingFoodTruck[];
    sunday: VisitingFoodTruck[];
  },
  dinner: {
    monday: VisitingFoodTruck[];
    tuesday: VisitingFoodTruck[];
    wednesday: VisitingFoodTruck[];
    thursday: VisitingFoodTruck[];
    friday: VisitingFoodTruck[];
    saturday: VisitingFoodTruck[];
    sunday: VisitingFoodTruck[];
  }
}

/**
 * Uses a http request to fetch the current food truck data page.
 * The returned Page object should only be used by passing it to dataByLocation. It
 * specifically is not part of the public api.
 */
fetchCurrentPage(): Promise<Page>;

/**
 * Processes the Page object to extract the FoodTruckSchedule for the given location.
 */
getFoodTruckSchedule(page: Page, location: string): FoodTruckSchedule; 

Keywords

FAQs

Package last updated on 28 Mar 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc