Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

293
Visualizações
How to find exact sentence in javascript?

I'm using a bot that matches a given string on tweets. The thing is that it matches tweets that have the two words but not together ("futbol team") and in the order, I've written.

    const mediaArtsSearch = { 
        q: "futbol team", 
        count: 100, 
        result_type: "recent" 
    };

Here the code:

// Our Twitter library
const Twit = require("twit");

// We need to include our configuration file...
const twit = new Twit(require("./config.js"));

// This is the URL of a search for the latest tweets on the '#MeetMaye' hashtag...
const mediaArtsSearch = { q: "futbol team", count: 100, result_type: "recent" };

// This function finds the latest tweet with the MeetMaye hashtag and retweets.
const retweetLatest = () => {
  twit.get("search/tweets", mediaArtsSearch, (error, data) => {
    // If our search request to the server had no errors...
    if (error) {
      // However, if our original search request had an error, we want to print it out here...
      console.log(error.message);
    } else {
      // Grab the ID of the tweet we want to retweetwit...
      const retweetId = data.statuses[0].id_str;
      // Tell Twitter we want to retweet it...
      twit.post("statuses/retweet/" + retweetId, {}, (error, response) => {
        if (response) {
          console.log("Success! Your bot has retweeted something.");
        }
        // If there was an error with our Twitter call, we print it out here...
        if (error) {
          console.log(error.message);
        }
      });
    }
  });
};

// Try to retweet something as soon as we run the program...
retweetLatest();
// ...and then every hour/half thereafter. Time here is in milliseconds, so
// 1000 ms = 1 second, 1 sec * 60 = 1 min, 1 min * 60 = 1 hour --> 1000 * 60 * 60
setInterval(retweetLatest, 1000 * 60 * 30);

Appreciate your time

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda