PageSourceSearch

https://haddocktechnics.nl/wp-content/plugins/wp-football-livestream/assets/js/app.js?v=1791592116

js haddocktechnics.nl collected 2026-10-10 00:28:54 UTC 3,789 bytes, 100 lines download raw bytes

1const state = Vue.reactive({
2  fixtures: [],        // Dữ liệu từ API fixtures
3  liveFixtures: [],    // Dữ liệu từ API live fixtures
4  leaguesFixtures: [],// Dữ liệu từ API Giải đấu
5  countType: [],
6  loading: true,
7  error: null,
8  leagueFiltered: null,
9  leagueFilteredCheckbox: null,
10  isLoadingFixtures: false,  // Đang load API fixtures
11  isLoadingLiveFixtures: false,  // Đang load API live fixtures
12  isFetched: false, // Đảm bảo chỉ gọi API một lần
13});
14
15// Hàm fetchFixtures được gọi một lần để tải dữ liệu ban đầu
16async function fetchFixtures() {
17  // Nếu dữ liệu đã được tải hoặc đang tải, không cần gọi lại API
18  if (state.isFetched || state.isLoadingFixtures || state.isLoadingLiveFixtures) {
19    return;
20  }
21
22  state.loading = true;
23  state.isLoadingFixtures = true;
24  state.isLoadingLiveFixtures = true;
25  state.error = null;
26  const currentTime = Date.now();
27  const fixturesLiveUrl = `https://live-api.keovip88.net/storage/livestream/live.json?t=${currentTime}`;
28  const fixturesUrl = `https://live-api.keovip88.net/storage/livestream/all.json?t=${currentTime}`;
29  try {
30    // Gọi đồng thời hai API
31    const [fixturesLiveResponse, fixturesResponse] = await Promise.all([
32      fetch(fixturesLiveUrl),
33      fetch(fixturesUrl)
34    ]);
35
36    // Kiểm tra phản hồi từ API
37    if (!fixturesLiveResponse.ok) {
38      throw new Error('Failed to fetch live fixtures');
39    }
40    if (!fixturesResponse.ok) {
41      throw new Error('Failed to fetch fixtures');
42    }
43
44    // Chuyển đổi kết quả sang JSON
45    const resultFixturesLiveData = await fixturesLiveResponse.json();
46    const resultFixturesData = await fixturesResponse.json();
47    // Cập nhật state với dữ liệu mới
48    state.fixtures = resultFixturesData.response;
49    state.liveFixtures = resultFixturesLiveData.response;
50    const combinedFixtures = [...resultFixturesData.response, ...resultFixturesLiveData.response];
51    combinedFixtures.forEach((item) => {
52      const exists = state.leaguesFixtures.some((league) => league.title === item.league.title);
53      if (!exists) {
54        state.leaguesFixtures.push(item.league);
55      }
56    });
57    // Đánh dấu rằng dữ liệu đã được tải xong
58    state.isFetched = true;
59
60  } catch (err) {
61    state.error = err.message;
62  } finally {
63    state.loading = false;
64    state.isLoadingFixtures = false;
65    state.isLoadingLiveFixtures = false;
66  }
67}
68
69// Hàm fetch API live fixtures (để cập nhật live fixtures mỗi 10 giây)
70async function fetchLiveFixtures() {
71  if (state.isLoadingLiveFixtures) return;  // Kiểm tra xem đã có một cuộc gọi nào đang diễn ra chưa
72  state.isLoadingLiveFixtures = true;
73
74  try {
75    const currentTime = Date.now();
76    const liveFixturesUrl = `https://live-api.keovip88.net/storage/livestream/live.json?t=${currentTime}`;
77    const response = await fetch(liveFixturesUrl);
78    if (!response.ok) {
79      throw new Error('Failed to fetch live fixtures');
80    }
81    const data = await response.json();
82    state.liveFixtures = data.response;
83    state.liveFixtures.forEach((item) => {
84      const exists = state.leaguesFixtures.some((league) => league.title === item.league.title);
85      if (!exists) {
86        state.leaguesFixtures.push(item.league);
87      }
88    });
89  } catch (err) {
90    state.error = err.message;
91  } finally {
92    state.isLoadingLiveFixtures = false;
93  }
94}
95
96// Gọi hàm fetchFixtures khi component được khởi tạo
97fetchFixtures();
98
99// Đặt interval để gọi fetchLiveFixtures mỗi 10 giây
100setInterval(fetchLiveFixtures, 10000); // 10000ms = 10 giây

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.