Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 15 20:01
  • Oct 15 12:17
    scala-steward opened #435
  • Oct 11 20:20
    scala-steward opened #434
  • Oct 02 08:01

    DanielaSfregola on main

    Add "following" TweetReplySetti… Merge pull request #433 from Co… (compare)

  • Oct 02 08:01
    DanielaSfregola closed #433
  • Sep 30 20:59
    ConnorSinnott commented #433
  • Sep 30 20:56
    ConnorSinnott opened #433
  • Sep 18 12:26
    scala-steward opened #432
  • Sep 15 07:20

    DanielaSfregola on main

    Update scala-library to 2.12.15 Merge pull request #431 from sc… (compare)

  • Sep 15 07:20
    DanielaSfregola closed #431
  • Sep 14 20:26
    scala-steward opened #431
  • Sep 14 17:39

    DanielaSfregola on main

    Apply method for TwitterRestV2C… Merge pull request #430 from Co… (compare)

  • Sep 14 17:39
    DanielaSfregola closed #430
  • Sep 14 14:54
    ConnorSinnott opened #430
  • Sep 14 07:59

    DanielaSfregola on main

    Add MediaType enum Merge pull request #429 from Co… (compare)

  • Sep 14 07:59
    DanielaSfregola closed #429
  • Sep 13 17:01
    ConnorSinnott commented #429
  • Sep 13 16:57
    ConnorSinnott synchronize #429
  • Sep 13 16:54
    ConnorSinnott opened #429
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
:)
Soren
@srnb_gitlab
@DanielaSfregola I'm getting java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI trying to publishLocal on my machine after fixing #341
or rather, I'm attempting to fix #341
[error] java.io.IOError: java.lang.RuntimeException: /packages cannot be represented as URI
[error] java.base/jdk.internal.jrtfs.JrtPath.toUri(JrtPath.java:176)
[error] scala.tools.nsc.classpath.JrtClassPath.asURLs(DirectoryClassPath.scala:216)
[error] scala.tools.nsc.classpath.AggregateClassPath.$anonfun$asURLs$1(AggregateClassPath.scala:63)
[error] scala.collection.StrictOptimizedIterableOps.flatMap(StrictOptimizedIterableOps.scala:118)
[error] scala.collection.StrictOptimizedIterableOps.flatMap$(StrictOptimizedIterableOps.scala:105)
[error] scala.collection.immutable.Vector.flatMap(Vector.scala:113)
[error] scala.tools.nsc.classpath.AggregateClassPath.asURLs(AggregateClassPath.scala:63)
[error] scala.tools.nsc.plugins.Plugins.findMacroClassLoader(Plugins.scala:184)
[error] scala.tools.nsc.plugins.Plugins.findMacroClassLoader$(Plugins.scala:178)
[error] scala.tools.nsc.Global.findMacroClassLoader(Global.scala:46)
[error] scala.reflect.macros.runtime.MacroRuntimes.$anonfun$defaultMacroClassloaderCache$1(MacroRuntimes.scala:58)
[error] scala.reflect.internal.SymbolTable$perRunCaches$$anon$3.apply(SymbolTable.scala:481)
[error] scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader(MacroRuntimes.scala:59)
[error] scala.reflect.macros.runtime.MacroRuntimes.defaultMacroClassloader$(MacroRuntimes.scala:59)
[error] scala.tools.nsc.Global$$anon$5.defaultMacroClassloader(Global.scala:482)
[error] scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveRuntime(MacroRuntimes.scala:77)
[error] scala.reflect.macros.runtime.MacroRuntimes.$anonfun$standardMacroRuntime$3(MacroRuntimes.scala:50)
[error] scala.collection.mutable.MapOps.getOrElseUpdate(Map.scala:149)
[error] scala.collection.mutable.MapOps.getOrElseUpdate$(Map.scala:146)
[error] scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:260)
[error] scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime(MacroRuntimes.scala:50)
the stack trace goes on for a lot longer than this
Daniela Sfregola
@DanielaSfregola
Thanks @srnb_gitlab! Do you have a branch that I could look at?
Soren
@srnb_gitlab
@DanielaSfregola I fixed it by using sbt-extras and running SBT with JDK 8 instead of JDK 14
As for a fix to #341, I just added 3 lines of Option myself and my program runs fine
diff --git a/src/main/scala/com/danielasfregola/twitter4s/entities/User.scala b/src/main/scala/com/danielasfregola/twitter4s/entities/User.scala
index 00633cab..153405cd 100755
--- a/src/main/scala/com/danielasfregola/twitter4s/entities/User.scala
+++ b/src/main/scala/com/danielasfregola/twitter4s/entities/User.scala
@@ -22,15 +22,15 @@ final case class User(blocked_by: Boolean = false,
                       id_str: String,
                       is_translation_enabled: Boolean = false,
                       is_translator: Boolean = false,
-                      lang: String,
+                      lang: Option[String],
                       listed_count: Int,
                       location: Option[String] = None,
                       muting: Boolean = false,
                       name: String,
                       notifications: Boolean = false,
                       profile_background_color: String,
-                      profile_background_image_url: String,
-                      profile_background_image_url_https: String,
+                      profile_background_image_url: Option[String],
+                      profile_background_image_url_https: Option[String],
                       profile_background_tile: Boolean = false,
                       profile_banner_url: Option[String] = None,
                       profile_image_url: ProfileImage,
Daniela Sfregola
@DanielaSfregola
I am glad! @srnb_gitlab would you be willing to make a PR, so that we can fix it in the twitter4s branch and do a release to fix it for everyone?
Soren
@srnb_gitlab
Sounds good @DanielaSfregola! I should have a PR by tonight when I'm on my Linux machine again
Daniela Sfregola
@DanielaSfregola
awesome, thank you :)
Soren
@srnb_gitlab
Sorry for not getting on this. It should be up within the next 24 hours. Been half-busy, half-procrastinating :/
Daniela Sfregola
@DanielaSfregola
no worries @srnb_gitlab! :)
Soren
@srnb_gitlab
I keep on forgetting! :weary: