BingCollector

get bingchat faster, earn points everyday

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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();
//     }
// }