webpeel 0.21.76 → 0.21.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/domain-extractors.js +17 -28
- package/package.json +1 -1
|
@@ -5988,36 +5988,24 @@ async function googleFlightsExtractor(_html, url) {
|
|
|
5988
5988
|
unique.sort((a, b) => a.price - b.price);
|
|
5989
5989
|
// Helper: get airline booking URL
|
|
5990
5990
|
function getAirlineBookingUrl(airline, from, to, dateStr) {
|
|
5991
|
-
// Parse date from "Sat, Apr 4" → "2026-04-04" or "04/04/2026" etc.
|
|
5992
|
-
const months = { Jan: '01', Feb: '02', Mar: '03', Apr: '04', May: '05', Jun: '06', Jul: '07', Aug: '08', Sep: '09', Oct: '10', Nov: '11', Dec: '12' };
|
|
5993
|
-
let isoDate = '';
|
|
5994
|
-
let mmddDate = '';
|
|
5995
|
-
const dm = dateStr.match(/(\w{3})\s+(\d{1,2})/);
|
|
5996
|
-
if (dm) {
|
|
5997
|
-
const mon = months[dm[1]] || '01';
|
|
5998
|
-
const day = dm[2].padStart(2, '0');
|
|
5999
|
-
const year = new Date().getFullYear(); // current year
|
|
6000
|
-
isoDate = `${year}-${mon}-${day}`;
|
|
6001
|
-
mmddDate = `${mon}/${day}/${year}`;
|
|
6002
|
-
}
|
|
6003
5991
|
const fromUp = from.toUpperCase();
|
|
6004
5992
|
const toUp = to.toUpperCase();
|
|
6005
|
-
//
|
|
5993
|
+
// Airline homepages — direct booking pages (deep links don't work without session/cookies)
|
|
6006
5994
|
const urlMap = {
|
|
6007
|
-
'United': `https://www.united.com
|
|
6008
|
-
'Delta': `https://www.delta.com
|
|
6009
|
-
'JetBlue': `https://www.jetblue.com
|
|
6010
|
-
'American': `https://www.aa.com
|
|
6011
|
-
'Spirit': `https://www.spirit.com
|
|
6012
|
-
'Frontier': `https://www.flyfrontier.com
|
|
6013
|
-
'Southwest': `https://www.southwest.com
|
|
6014
|
-
'Breeze': `https://www.flybreeze.com
|
|
6015
|
-
'Alaska': `https://www.alaskaair.com
|
|
6016
|
-
'Hawaiian': `https://www.hawaiianairlines.com
|
|
6017
|
-
'Sun Country': `https://www.suncountry.com
|
|
6018
|
-
'Avelo': `https://www.aveloair.com
|
|
5995
|
+
'United': `https://www.united.com`,
|
|
5996
|
+
'Delta': `https://www.delta.com`,
|
|
5997
|
+
'JetBlue': `https://www.jetblue.com`,
|
|
5998
|
+
'American': `https://www.aa.com`,
|
|
5999
|
+
'Spirit': `https://www.spirit.com`,
|
|
6000
|
+
'Frontier': `https://www.flyfrontier.com`,
|
|
6001
|
+
'Southwest': `https://www.southwest.com`,
|
|
6002
|
+
'Breeze': `https://www.flybreeze.com`,
|
|
6003
|
+
'Alaska': `https://www.alaskaair.com`,
|
|
6004
|
+
'Hawaiian': `https://www.hawaiianairlines.com`,
|
|
6005
|
+
'Sun Country': `https://www.suncountry.com`,
|
|
6006
|
+
'Avelo': `https://www.aveloair.com`,
|
|
6019
6007
|
};
|
|
6020
|
-
return urlMap[airline] || `https://www.google.com/travel/flights?q=${encodeURIComponent(`${airline} flights ${
|
|
6008
|
+
return urlMap[airline] || `https://www.google.com/travel/flights?q=${encodeURIComponent(`${airline} flights ${fromUp} to ${toUp} ${dateStr}`)}`;
|
|
6021
6009
|
}
|
|
6022
6010
|
// Parse route from URL
|
|
6023
6011
|
const u = new URL(url);
|
|
@@ -6037,11 +6025,12 @@ async function googleFlightsExtractor(_html, url) {
|
|
|
6037
6025
|
md.push(`🛫 ${f.fromAirport} → ${f.toAirport} · ${f.duration} · ${f.stops}`);
|
|
6038
6026
|
if (f.bags)
|
|
6039
6027
|
md.push(`🧳 ${f.bags}`);
|
|
6040
|
-
md.push(
|
|
6028
|
+
md.push(`🔍 [See price on Google Flights](${url})`);
|
|
6029
|
+
md.push(`🛒 [Book on ${f.airline}](${bookingUrl})`);
|
|
6041
6030
|
md.push('');
|
|
6042
6031
|
}
|
|
6043
6032
|
md.push('---');
|
|
6044
|
-
md.push(`📌 *
|
|
6033
|
+
md.push(`📌 *All prices verified via [Google Flights](${url}). Click "See price" to confirm, then book directly with the airline.*`);
|
|
6045
6034
|
return {
|
|
6046
6035
|
domain: 'google.com/travel/flights',
|
|
6047
6036
|
type: 'flights',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpeel",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.77",
|
|
4
4
|
"description": "Fast web fetcher for AI agents - stealth mode, crawl mode, page actions, structured extraction, PDF parsing, smart escalation from simple HTTP to headless browser",
|
|
5
5
|
"author": "Jake Liu",
|
|
6
6
|
"license": "AGPL-3.0-only",
|