Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 03 13:13
    codecov[bot] commented #281
  • Dec 03 13:12
    mergify[bot] commented #281
  • Dec 03 13:12

    mergify[bot] on master

    Update akka-http to 10.1.11 Merge pull request #281 from sc… (compare)

  • Dec 03 13:12
    mergify[bot] closed #281
  • Dec 03 13:12
    codecov[bot] commented #281
  • Dec 03 13:12
    codecov[bot] commented #281
  • Dec 02 21:27
    scala-steward opened #281
  • Nov 29 02:39
    mergify[bot] commented #38
  • Nov 29 02:39
    mergify[bot] commented #38
  • Nov 29 02:39

    mergify[bot] on master

    Update sbt to 1.3.4 Merge pull request #38 from sca… (compare)

  • Nov 29 02:39
    mergify[bot] closed #38
  • Nov 29 02:39
    mergify[bot] commented #37
  • Nov 29 02:39

    mergify[bot] on master

    Update sbt-scalafmt to 1.16 Merge pull request #37 from sca… (compare)

  • Nov 29 02:39
    mergify[bot] closed #37
  • Nov 29 02:36
    scala-steward opened #38
  • Nov 29 02:36
    scala-steward opened #37
  • Nov 27 05:05
    scala-steward opened #16
  • Nov 23 15:24
    codecov[bot] commented #280
  • Nov 23 15:24
    codecov[bot] commented #280
  • Nov 23 15:24
    mergify[bot] commented #280
karim khalfaoui
@Kaiiim
i going to try now :) :) :)
Daniela Sfregola
@DanielaSfregola
restClient and streamingClient are initialized correctly
however, client is missing the tokens
you either pass the tokens via code (as you did for restClient and streamingClient) OR you pass nothing and we'll search for env variables with specific names (like you did for client)
.....does it make sense?
karim khalfaoui
@Kaiiim
yes, if i understant i've read 10 time your #usage :)
the code is you want
Daniela Sfregola
@DanielaSfregola
Ok, what happens when you run that code?
what do you see in the println?
karim khalfaoui
@Kaiiim
i saw "Exception in thread "main" java.lang.RuntimeException: [twitter4s] configuration missing: Environment variable TWITTER_CONSUMER_TOKEN_KEY or configuration twitter.consumer.key not found.
"
Process finished with exit code 1
Daniela Sfregola
@DanielaSfregola
is there a stacktrace?
karim khalfaoui
@Kaiiim
"None"
but the env have the value of token and access
at com.danielasfregola.twitter4s.util.ConfigurationDetector.envVarOrConfig(Configurations.scala:37)
at com.danielasfregola.twitter4s.util.ConfigurationDetector.envVarOrConfig$(Configurations.scala:30)
at com.danielasfregola.twitter4s.util.Configurations$.envVarOrConfig(Configurations.scala:7)
at com.danielasfregola.twitter4s.util.Configurations$.consumerTokenKey$lzycompute(Configurations.scala:11)
at com.danielasfregola.twitter4s.util.Configurations$.consumerTokenKey(Configurations.scala:11)
at com.danielasfregola.twitter4s.TwitterRestClient$.apply(TwitterRestClient.scala:65)
at ScalaTwitterClientExample$.main(ScalaTwitterClientExample.scala:38)
at ScalaTwitterClientExample.main(ScalaTwitterClientExample.scala)
the code doesn't find the env value
Daniela Sfregola
@DanielaSfregola
if you see None, it means that it couldn't find the env variable
karim khalfaoui
@Kaiiim
yes but i dont unserstand why. when i make "env" command i saw the env value
Daniela Sfregola
@DanielaSfregola
how do you run your application? using the terminal? or using an IDE such as intellij?
karim khalfaoui
@Kaiiim
in intelij
Daniela Sfregola
@DanielaSfregola
in intellji you need to access the run configurations and add the env variables there...have you done that?
btw, you will need 4 env variables, not just one :)
Also, why do you need 2 streaming clients? i.e. why do you need line 42?
karim khalfaoui
@Kaiiim
i've added the env variable on iterm application (terminal for mac). and in intelij when i try env i saw variable (the 4 variables)
Daniela Sfregola
@DanielaSfregola
what happens if you open a new terminal and type: printenv | grep TWITTER
karim khalfaoui
@Kaiiim
i suppose i need to create "restClient" and "streamingClient" and after "client" ?
i can see the 4 values
Daniela Sfregola
@DanielaSfregola
nah, you need either streamingClient or client
karim khalfaoui
@Kaiiim
ahhhh !
Daniela Sfregola
@DanielaSfregola
what happens if you delete client?
karim khalfaoui
@Kaiiim
it's like this I do a while 1
no error
Daniela Sfregola
@DanielaSfregola
nice :)
karim khalfaoui
@Kaiiim
I thought that i need to initialise client after !
sorry :/
:)
Daniela Sfregola
@DanielaSfregola
ok, your problem is actually not twitter4s, but it is related to your setup: your iterm env variables are not accessible to intellji
unfortunately I do not use iterm, so I cannot help with that
karim khalfaoui
@Kaiiim
when i print env | grep TWITTER i can see 4 value on intelij
in the terminal to intelij
Daniela Sfregola
@DanielaSfregola
....but it seems like you already have the tokens in your code, so that should be enough to get you going :)
it probably depends on the run configuration of your program in Intellji
karim khalfaoui
@Kaiiim
yes. Do you have a tips if i want to get the hashtag ? for send all in kafka and after get top 3 hastag in last hour
Daniela Sfregola
@DanielaSfregola
have a look at https://github.com/DanielaSfregola/twitter4s-demo: I think we have a few examples of people working with hashtags
karim khalfaoui
@Kaiiim
thanks a lot daniela ! :)
Daniela Sfregola
@DanielaSfregola
but no kafka examples... :P
np
karim khalfaoui
@Kaiiim
kafka is after, first i need to get hastag :p
:)