Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

356
Views
API de Twitter: ¿cómo verificar si a un usuario específico le gustó un tweet específico?

Estoy usando la API de twitter v2 para el nodo, puedo extraer a todos los usuarios a los que les gustó un twitter y usar un si en un bucle, para verificar si el usuario que quiero está dentro de la matriz, pero dependiendo de si el tweet tiene muchos me gusta, el bucle se vuelve demasiado largo.

Me gustaria saber si hay alguna forma de ir directo a la informacion sin necesidad del loop, si hay algun filtro o algo.

 const client = twitterApi({ token, secret }) const usersLiked = await client.v2.tweetLikedBy(target, { asPaginator: true, }) for await (const user of usersLiked) { if (user.id === userIdTwitter) { await task.related('users').attach([userId]) return response.ok({}) } } return response.notFound()
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

La búsqueda binaria podría ayudarte en esta situación. La búsqueda binaria es un algoritmo de búsqueda que divide la búsqueda haciéndola más rápida, lo que es mejor que mirar y comparar uno por uno. Un detalle importante es que esta matriz debe estar en orden ascendente antes de buscar. Espero haber sido útil de alguna manera.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!