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

216
Visualizações
How do I use twitter-text in a browser

I want to count tweet length. Twitter makes this very very hard.

They have this repo: https://github.com/twitter/twitter-text which contains this folder: https://github.com/twitter/twitter-text/tree/master/js which supposedly supports javascript.

When I try to use the script from a cdn like this: https://www.jsdelivr.com/package/npm/twitter-text

it says require is not defined

I don't understand what I'm supposed to do. Why is it using require if it's for javascript?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

  1. Install Browserify
  2. Download the latest twitter-text script from this folder: https://github.com/twitter/twitter-text/tree/master/js/pkg
  3. Create index.js with the contents: window.twitter = require('./twitter-text-3.1.0.min.js');
  4. Run browserify index.js -o twitter-text-js.js

The output file can now be run in browser and accessed with the global twitter.

(or just download the prepackaged version here: https://gist.github.com/skeddles/3841236279efebf053dfa39dfdbae2c2#file-twitter-text-js-js)

about 4 years ago · Juan Pablo Isaza Relatório
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