-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
203 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
API Reference | ||
============= | ||
|
||
This section provides detailed information about the functions available in ScrapeBnB. | ||
|
||
getFromRoomUrl | ||
-------------- | ||
|
||
Fetches detailed information about a specific Airbnb listing. | ||
|
||
- **Parameters**: | ||
- ``roomURL`` (string): The full URL of the Airbnb listing. | ||
- ``currency`` (string): The currency code (e.g., 'USD', 'EUR'). | ||
- ``checkIn`` (string): Check-in date in 'YYYY-MM-DD' format. | ||
- ``checkOut`` (string): Check-out date in 'YYYY-MM-DD' format. | ||
- ``proxyUrl`` (string, optional): Proxy URL if you're using one. | ||
|
||
- **Returns**: A Promise that resolves with the listing details. | ||
|
||
Example: | ||
|
||
.. code-block:: javascript | ||
const details = await airbnbScraper.getFromRoomUrl( | ||
'https://www.airbnb.com/rooms/12345678', | ||
'USD', | ||
'2024-09-01', | ||
'2024-09-07' | ||
); | ||
getFromRoomId | ||
------------- | ||
|
||
Fetches detailed information about a specific Airbnb listing using the room ID. | ||
|
||
- **Parameters**: | ||
- ``roomId`` (string): The Airbnb room ID. | ||
- ``currency`` (string): The currency code (e.g., 'USD', 'EUR'). | ||
- ``checkIn`` (string): Check-in date in 'YYYY-MM-DD' format. | ||
- ``checkOut`` (string): Check-out date in 'YYYY-MM-DD' format. | ||
- ``proxyUrl`` (string, optional): Proxy URL if you're using one. | ||
|
||
- **Returns**: A Promise that resolves with the listing details. | ||
|
||
searchAll | ||
--------- | ||
|
||
Performs a search and returns all results for a given area and date range. | ||
|
||
- **Parameters**: | ||
- ``checkIn`` (string): Check-in date in 'YYYY-MM-DD' format. | ||
- ``checkOut`` (string): Check-out date in 'YYYY-MM-DD' format. | ||
- ``neLat`` (number): Northeast latitude of the area. | ||
- ``neLong`` (number): Northeast longitude of the area. | ||
- ``swLat`` (number): Southwest latitude of the area. | ||
- ``swLong`` (number): Southwest longitude of the area. | ||
- ``zoomValue`` (number): Zoom level for the search. | ||
- ``currency`` (string): The currency code (e.g., 'USD', 'EUR'). | ||
- ``proxyUrl`` (string, optional): Proxy URL if you're using one. | ||
|
||
- **Returns**: A Promise that resolves with the search results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# conf.py - Sphinx configuration file for ScrapeBnB documentation | ||
|
||
import os | ||
import sys | ||
|
||
# Add the project root directory to the Python path for autodoc | ||
sys.path.insert(0, os.path.abspath('../')) | ||
|
||
# Project information | ||
project = 'ScrapeBnB' | ||
author = 'Michael Adrian' | ||
copyright = '2024, Michael Adrian' | ||
release = '1.1.1' | ||
|
||
# General configuration | ||
extensions = [ | ||
'sphinx.ext.autodoc', # Automatically document from docstrings | ||
'sphinx.ext.napoleon', # Support for Google style docstrings | ||
'sphinx.ext.viewcode', # Add links to source code | ||
'sphinx.ext.todo', # Support for TODOs | ||
] | ||
|
||
# Templates path | ||
templates_path = ['_templates'] | ||
|
||
# Exclude patterns for files | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
# HTML output configuration | ||
html_theme = 'alabaster' # You can choose another theme if you prefer | ||
html_static_path = ['_static'] | ||
|
||
# Options for autodoc | ||
autodoc_member_order = 'bysource' | ||
|
||
# Napoleon settings for Google and NumPy style docstrings | ||
napoleon_google_docstring = True | ||
napoleon_numpy_docstring = False | ||
|
||
# Enable TODOs (you can remove this if you don't plan to use TODOs in the docs) | ||
todo_include_todos = True | ||
|
||
# Custom sidebar configuration (optional, for alabaster theme) | ||
html_sidebars = { | ||
'**': [ | ||
'about.html', | ||
'navigation.html', | ||
'searchbox.html', | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Welcome to ScrapeBnB's documentation! | ||
===================================== | ||
|
||
Contents: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Table of Contents | ||
|
||
introduction | ||
installation_usage | ||
api_reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Installation & Usage | ||
==================== | ||
|
||
This section covers how to install and use **ScrapeBnB** in your Node.js project. | ||
|
||
Installation | ||
------------ | ||
|
||
To install **ScrapeBnB**, use the following command: | ||
|
||
.. code-block:: bash | ||
npm install scrapebnb | ||
Ensure you have Node.js installed. ScrapeBnB requires Node.js version 12 or higher. | ||
|
||
Usage | ||
----- | ||
|
||
Once installed, you can import the ScrapeBnB package in your JavaScript file and start scraping Airbnb data. | ||
|
||
Basic Example | ||
------------- | ||
|
||
.. code-block:: javascript | ||
const airbnbScraper = require('scrapebnb'); | ||
async function getListingDetails() { | ||
try { | ||
const details = await airbnbScraper.getFromRoomUrl( | ||
'https://www.airbnb.com/rooms/12345678', | ||
'USD', | ||
'2024-09-01', | ||
'2024-09-07' | ||
); | ||
console.log(details); | ||
} catch (error) { | ||
console.error('Error fetching listing details:', error); | ||
} | ||
} | ||
getListingDetails(); | ||
Proxy Usage | ||
----------- | ||
|
||
If you're using a proxy to avoid rate limiting or IP blocking, you can pass the proxy URL as an argument to the scraping functions. | ||
|
||
.. code-block:: javascript | ||
const proxyUrl = 'http://your-proxy-url.com'; | ||
const details = await airbnbScraper.getFromRoomUrl( | ||
'https://www.airbnb.com/rooms/12345678', | ||
'USD', | ||
'2024-09-01', | ||
'2024-09-07', | ||
proxyUrl | ||
); | ||
Note: Always comply with Airbnb's terms of service when scraping their website. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ScrapeBnB | ||
========= | ||
|
||
**ScrapeBnB** is a powerful and easy-to-use Node.js package designed for scraping Airbnb property data. It allows you to extract detailed information such as listings, prices, and search results with just a few function calls. | ||
|
||
Features | ||
-------- | ||
|
||
- Fetch detailed listing information by URL or Room ID. | ||
- Perform area searches and get all results with specified filters. | ||
- Get pricing details for Airbnb listings. | ||
- Includes support for proxies to avoid IP blocking. | ||
|
||
Why ScrapeBnB? | ||
-------------- | ||
|
||
If you're building analytics tools, market research, or just curious about Airbnb data, ScrapeBnB simplifies the task. Whether you're a developer or a data enthusiast, this tool is designed to be intuitive and efficient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters