• Как с помощью SQL запроса выбрать из строки значения и посчитать их уникальное количество?

    @DKSoft
    Можно попробовать так
    with a as  #преобоазуем в json массив
    (select id,concat('[',replace(descr,'}{','},{'),']') as d1
     from x1
    )
    ,b as ( # массив в таблицу
    select id,JSON_EXTRACT(d1, '$[1]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[2]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[3]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[4]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[5]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[6]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[7]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[8]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[9]') as d2
     from a
    union all
    select id,JSON_EXTRACT(d1, '$[10]') as d2
     from a
    )
    -- подсчет
    select id,count(distinct JSON_VALUE(d2,'$.DeviceID')) as count
    from b
    where b.d2 is not null
    group by id

    если в поле descr больше 10 элементиов то надо добавить в b допролнительные union all
    Ответ написан
    Комментировать
  • Есть ли сервисы по отправке SMS по API с тестовым периодом?

    @DKSoft
    Есть такой сервис https://sandbox.httpsms.com/ - позволяет отправлять бесплатно смс
    Возможно он подойдет
    Ответ написан
  • Могут ли без следов иметь доступ к android устройству?

    @DKSoft
    В настройках Telegram и Whatsapp посмотрите на каких устройствах есть активные сессии.
    Лучше их всех закрыть и заходить по мере необходимости.
    В настройках телефона посмотрите каким приложениям даны разрешения
    Ответ написан
  • Как спарсить котировки в Google Sheets?

    @DKSoft
    Если готовы использовать node.js то приблизительно так
    const { chromium } = require('playwright');
    const { google } = require('googleapis');
    
    async function run {
    try{
    //Парсим данные
     const browser = await chromium.launch({
        headless: true
      });
      const context = await browser.newContext();
      const page    = await context.newPage();
      const sURL="https://quote.eastmoney.com/qihuo/OI409.html"
      await page.goto(sURL);
      await page.waitForTimeout(3000); //почему то на стандартном waitForLoad после 2-х раз не дало загрузить 
      var data=await page.locator("div.zxj").innerText(); // наша цифра тут
    console.log(data); //контрольный вывод                 
      await context.close();
      await browser.close();
    //Записываем в таблицу
    const auth = new google.auth.GoogleAuth({
      keyFile: 'token.json',
      scopes: ['https://www.googleapis.com/auth/spreadsheets']
    });
    //-----------------------------------------------------------------
    const sheets = google.sheets({ version: 'v4', auth });
    var spreadsheetId="spreadsheetId"; //id табицы
    var range="Sheet1!A1:A1" //лист и диапазон
    var values = [];
    values[0]=data;
    sheets.spreadsheets.values.update({
      spreadsheetId,
      range,
      valueInputOption: 'RAW',
      resource: {
        values
      }
    }, (err, res) => {
      if (err) return console.log(`The API returned an error: ${err}`);
      console.log(res.data);
    });
      
    } catch (error) {
      console.log(error);
      }                   
                       }
    run();
    Ответ написан