1export default async function (req: Request): Promise<Response> {
2return new Response(`Hellom XYZ\n${Date.now() % 100000000}`, {
3headers: {
1export default async function (req: Request): Promise<Response> {
2return new Response(`Hellom XYZ\n${Date.now() % 100000000}`, {
3headers: {
scrapetestREADME.md1 match
7- **Flight Search Form** - Enter origin, destination, and travel dates
8- **Real-time Results** - Display scraped flight information in a user-friendly format
9- **Export Functionality** - Download results as JSON for further analysis
10- **Error Handling** - Clear error messages and loading states
11- **Responsive Design** - Works on desktop and mobile devices
scrapetestscraper.ts8 matches
1import { FlightSearchParams, FlightResult, ScrapingResult } from "../shared/types.ts";
23export async function scrapeFlights(params: FlightSearchParams): Promise<ScrapingResult> {
4const { origin, destination, departDate, returnDate } = params;
5
57}
5859async function scrapeFrontierDirect(params: FlightSearchParams): Promise<ScrapingResult> {
60const searchUrl = buildFrontierSearchUrl(params);
61console.log(`Direct search URL: ${searchUrl}`);
88}
8990async function scrapeFrontierMainPage(params: FlightSearchParams): Promise<ScrapingResult> {
91console.log("Trying main page approach...");
92
120}
121122async function generateSampleData(params: FlightSearchParams): Promise<ScrapingResult> {
123console.log("Generating sample data as fallback...");
124
198}
199200function buildFrontierSearchUrl(params: FlightSearchParams): string {
201// Try multiple URL patterns that Frontier might use
202const patterns = [
218}
219220function parseFlightData(html: string): FlightResult[] {
221const flights: FlightResult[] = [];
222
261}
262263function parseJsonFlightData(data: any[]): FlightResult[] {
264const flights: FlightResult[] = [];
265
294}
295296function parseHtmlFlightData(html: string): FlightResult[] {
297const flights: FlightResult[] = [];
298
scrapetestapp.js12 matches
1let currentResults = null;
23document.addEventListener('DOMContentLoaded', function() {
4const searchForm = document.getElementById('searchForm');
5const searchBtn = document.getElementById('searchBtn');
14document.getElementById('departDate').value = tomorrow.toISOString().split('T')[0];
1516searchForm.addEventListener('submit', async function(e) {
17e.preventDefault();
18
28});
2930exportBtn.addEventListener('click', function() {
31if (currentResults) {
32downloadJSON(currentResults, `frontier-flights-${Date.now()}.json`);
34});
3536async function searchFlights(params) {
37try {
38showLoading();
65}
6667function displayResults(data) {
68const resultsContent = document.getElementById('resultsContent');
69
160}
161162function showLoading() {
163loading.classList.remove('hidden');
164searchBtn.disabled = true;
166}
167168function hideLoading() {
169loading.classList.add('hidden');
170searchBtn.disabled = false;
172}
173174function showResults() {
175results.classList.remove('hidden');
176}
177178function hideResults() {
179results.classList.add('hidden');
180}
181182function showError(message) {
183document.getElementById('errorMessage').textContent = message;
184error.classList.remove('hidden');
185}
186187function hideError() {
188error.classList.add('hidden');
189}
190191function downloadJSON(data, filename) {
192const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
193const url = URL.createObjectURL(blob);
MindfulMilescada_quince_minutes.ts2 matches
1function sendNotification() {
2const TOKEN = process.env.TELEGRAM_BOT_TOKEN;
3const CHAT_ID = 1825527066;
26* Главная функция cron-триггера
27*/
28export default async function() {
29sendNotification();
30}
EEPPortalweeklyReport.tsx6 matches
246};
247248function WeeklyReportTab() {
249// State for the detailed report (news and media)
250const [detailedReport, setDetailedReport] = useState(null);
290const [selectedContent, setSelectedContent] = useState("");
291292// Function to fetch the detailed report
293const fetchDetailedReport = async () => {
294setDetailedReport(null); // Clear previous detailed data while fetching
303};
304305// Function to fetch the weekly summary report with custom days
306const fetchWeeklySummary = async (days = 7) => {
307setWeeklySummary(null); // Clear previous summary data while fetching
455}, [weeklySummary]);
456457// Function to handle click on author name in Weekly Summary
458const handleAuthorClick = (authorId, authorFullName) => {
459if (!detailedReport || !detailedReport.newsArticles || !detailedReport.mediaEntries) {
482};
483484// Function to close the author detail modal
485const handleCloseAuthorDetailModal = () => {
486setIsAuthorDetailModalOpen(false);
490};
491492// Helper function for CSV export
493const exportToCSV = (data, filename) => {
494if (!data || data.length === 0) {
EEPPortalnewsArticle.tsx6 matches
388);
389// Main Component for the News Article (Contents) Tab
390export function NewsArticleTab({ user }: { user: CurrentUser | null }) {
391const [articles, setArticles] = useState<Article[]>([]);
392const [title, setTitle] = useState("");
580}
581};
582// Function to open the edit modal - Similar pattern to MediaMonitoringTab
583const handleEditClick = (article: Article) => {
584setEditFormData({
598setEditModalError(""); // Clear modal-specific error
599};
600// Function to close the edit modal - Similar pattern to MediaMonitoringTab
601const handleCloseEditModal = () => {
602setIsEditModalOpen(false);
615setEditModalError(""); // Clear modal-specific error on close
616};
617// Function to handle changes in the edit modal form - Similar pattern to MediaMonitoringTab
618const handleEditFormChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
619const { name, value } = e.target;
623}));
624};
625// Function to save the edited entry
626const handleSaveEdit = async () => {
627// Validate required fields from editFormData
682}
683};
684// Function to clear all filters
685const clearFilters = () => {
686setTitleFilter("");
138color: BRAND_COLORS.darkGreen,
139marginBottom: "10px",
140cursor: "pointer", // Added for toggle functionality
141},
142commentItem: {
247}
248249export function FeedsTab(
250{ user, onNavigateToNewsArticleTab }: { user: CurrentUser | null; onNavigateToNewsArticleTab: () => void },
251) {
MindfulMilescada_hora.ts2 matches
1function sendNotification() {
2const TOKEN = process.env.TELEGRAM_BOT_TOKEN;
3const CHAT_ID = 1825527066;
26* Главная функция cron-триггера
27*/
28export default async function() {
29sendNotification();
30}