Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usa o google trends para exibir uma lista de palavras para o searchterm #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danielschmitz
Copy link
Collaborator

trends

@gabrielrufino
Copy link
Contributor

Ideia massa, mano!!!

index.js Outdated
async function getGoogleTrends () {
const parser = new Parser();
const trends = await parser.parseURL(TREND_URL);
return trends.items.map(i => i.title)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielschmitz , o que acha de fazer a seguinte mudança?

  • destructuring binding
//return trends.items.map(i => i.title)
return trends.items.map(({title}) => title);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

top ! Vou mudar no meu fork, mas como esse PR nao vai ser aprovado até que o @filipedeschamps termine os videos, melhor deixar aqui assim

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielschmitz sem problemas. Fico feliz por contribuir

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eu não faria isso. Destructuring "custa" bem mais que acesso a propriedade.
Mas vai do quanto se quer se gastar com CPU.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em suma, bonitinho mas ordinário. IMHO, pelo menos para 1 prop.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leodutra Entendi

@nandumoura
Copy link

Show de bola

@victorgois
Copy link

Genial, mano!

@flixing
Copy link

flixing commented Mar 4, 2019

ah garoto, aí sim

Copy link

@ninjaoboladao ninjaoboladao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

como vc fez pra fazer o robo identificar cada trend? tipo vc entrou no codigo fonte da pagina google trends e procurou no codigo?

@matheuschimelli
Copy link

@ninjaboladao ele acessou o RSS feed

@andreigorpa andreigorpa mentioned this pull request Mar 4, 2019
17 tasks
@TWTsnoW
Copy link

TWTsnoW commented Mar 4, 2019

@ninjaoboladao Ele entrou na url que está na constante TREND_URL. Para buscar os trends criou a função getGoogleTrends(), dentro dela ele criou um parser queque ele criou um parser, que basicamente te dá acesso aos elementos do site, e pediu os items dele, com esses items pegou e criou uma lista com a função map.

async function getGoogleTrends () {
    const parser = new Parser()
    const trends = await parser.parseURL(TREND_URL)
    return trends.items.map(({title}) => title)
  }

@edfcsx
Copy link

edfcsx commented Mar 9, 2019

Excelente ideia!

@leodutra
Copy link
Collaborator

Já fiz meu merge. Obrigado.

Copy link

@iamgoncalo iamgoncalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isto é para actualizar no "input.js" certo?
Não me está a dar certo depois de escolher o que eu quero do Google trends. O que posso fazer? Abraço!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.