BingCollector

get bingchat faster, earn points everyday

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         BingCollector
// @version      1.2.7
// @namespace    optionsx
// @description  get bingchat faster, earn points everyday
// @author       github.com/optionsx
// @match        https://www.bing.com/
// @match        https://www.bing.com/?FORM=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bing.com
// @grant        GM_openInTab
// @license MIT
// ==/UserScript==

(async () => {
  try {
    const source = await fetch(
      "https://www.bing.com/rewardsapp/flyoutdata?channel=BingFlyout"
    ).then((res) => res?.json());

    if (
      // not logged in or unsupported country
      source.IsAuthenticated !== true
    )
      return;

    // regex to get max search count && current search count in the source :)
    const maxSearch =
      source.FlyoutResult.UserStatus.Counters.PCSearch[0].PointProgressMax;
    let searchCount =
      source.FlyoutResult.UserStatus.Counters.PCSearch[0].PointProgress;

    // fetch random questions
    while (++searchCount < maxSearch) {
      const question = await fetch("https://www.boredapi.com/api/activity")
        .then((res) => res.json())
        .then((res) => res.activity);
      let url = `https://www.bing.com/search?q=${question}`;
      let newTab = GM_openInTab(url, { active: false, setParent: true });
      await new Promise((resolve) => setTimeout(resolve, 1500));
      newTab.close();
    }
  } catch (err) {
    console.error(err);
  }
})();

// if (await GM.getValue("count") === 0 && await GM.getValue("day") !== day) {
//     const source = await fetch(
//         "https://www.bing.com/rewardsapp/flyoutdata?channel=BingFlyout&partnerId=BingRewards",
//     ).then(res => res?.json())
//     if (source.IsAuthenticated !== true && source.IsRewardsUser !== true && source.IsUnsupportedCountry === false) return; // not logged in or unsupported country
//     // itterate through urlReward bonuses
//     for (let i = 0; i < source.FlyoutResult.MorePromotions.length; i++) {
//         const el = source.FlyoutResult.MorePromotions[i];
//         if (el.Complete !== true && el.IsRewardable === true) {
//             const newTab = GM_openInTab(el.DestinationUrl, { active: false, setParent: true })
//             await new Promise((resolve) => setTimeout(resolve, 1500));
//             newTab.close();
//         }
//     }

// itterate through search bonuses
// for (let i = 0; i < source.FlyoutResult.UserStatus.Counters['PCSearch'].length; i++) {
//     const el = source.FlyoutResult.UserStatus.Counters['PCSearch'][i];
//     if (el.Complete !== true && el.IsRewardable === true && el.PromotionType === "Search") {
//         const newTab = GM_openInTab(el.DestinationUrl, { active: false, setParent: true })
//         await new Promise((resolve) => setTimeout(resolve, 1500));
//         newTab.close();
//     }
// }