mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 22:58:54 +02:00
617c8c787d
Unified User Action (UUA) is a centralized, real-time stream of user actions on Twitter, consumed by various product, ML, and marketing teams. UUA makes sure all internal teams consume the uniformed user actions data in an accurate and fast way.
16 lines
719 B
Scala
16 lines
719 B
Scala
package com.twitter.unified_user_actions.adapter.common
|
|
|
|
import com.twitter.snowflake.id.SnowflakeId
|
|
import com.twitter.util.Time
|
|
|
|
object AdapterUtils {
|
|
def currentTimestampMs: Long = Time.now.inMilliseconds
|
|
def getTimestampMsFromTweetId(tweetId: Long): Long = SnowflakeId.unixTimeMillisFromId(tweetId)
|
|
|
|
// For now just make sure both language code and country code are in upper cases for consistency
|
|
// For language code, there are mixed lower and upper cases
|
|
// For country code, there are mixed lower and upper cases
|
|
def normalizeLanguageCode(inputLanguageCode: String): String = inputLanguageCode.toUpperCase
|
|
def normalizeCountryCode(inputCountryCode: String): String = inputCountryCode.toUpperCase
|
|
}
|