def twitter(legacy_name = NOT_GIVEN, legacy_nickname = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, nickname: nil, uid: Number.number(digits: 6).to_s)
rubocop:disable Metrics/ParameterLists
def twitter(legacy_name = NOT_GIVEN, legacy_nickname = NOT_GIVEN, legacy_uid = NOT_GIVEN, name: nil, nickname: nil, uid: Number.number(digits: 6).to_s)
# rubocop:enable Metrics/ParameterLists
warn_for_deprecated_arguments do |keywords|
keywords << :name if legacy_name != NOT_GIVEN
keywords << :nickname if legacy_nickname != NOT_GIVEN
keywords << :uid if legacy_uid != NOT_GIVEN
end
auth = Omniauth.new(name: name)
nickname ||= auth.name.downcase.delete(' ')
location = city_state
description = Lorem.sentence
{
provider: 'twitter',
uid: uid,
info: {
nickname: nickname,
name: auth.name,
location: location,
image: image,
description: description,
urls: {
Website: nil,
Twitter: "https://twitter.com/#{nickname}"
}
},
credentials: {
token: Crypto.md5,
secret: Crypto.md5
},
extra: {
access_token: '',
raw_info: {
name: auth.name,
listed_count: random_number_from_range(1..10),
profile_sidebar_border_color: Color.hex_color,
url: nil,
lang: 'en',
statuses_count: random_number_from_range(1..1000),
profile_image_url: image,
profile_background_image_url_https: image,
location: location,
time_zone: Address.city,
follow_request_sent: random_boolean,
id: uid,
profile_background_tile: random_boolean,
profile_sidebar_fill_color: Color.hex_color,
followers_count: random_number_from_range(1..10_000),
default_profile_image: random_boolean,
screen_name: '',
following: random_boolean,
utc_offset: timezone,
verified: random_boolean,
favourites_count: random_number_from_range(1..10),
profile_background_color: Color.hex_color,
is_translator: random_boolean,
friends_count: random_number_from_range(1..10_000),
notifications: random_boolean,
geo_enabled: random_boolean,
profile_background_image_url: image,
protected: random_boolean,
description: description,
profile_link_color: Color.hex_color,
created_at: Time.backward.strftime('%a %b %d %H:%M:%S %z %Y'),
id_str: uid,
profile_image_url_https: image,
default_profile: random_boolean,
profile_use_background_image: random_boolean,
entities: {
description: {
urls: []
}
},
profile_text_color: Color.hex_color,
contributors_enabled: random_boolean
}
}
}
end