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

get_lists_members returning empty list #41

Open
alexpkeil1 opened this issue Oct 7, 2020 · 1 comment
Open

get_lists_members returning empty list #41

alexpkeil1 opened this issue Oct 7, 2020 · 1 comment

Comments

@alexpkeil1
Copy link
Contributor

get_lists_members is trying to parse a list of users. If you change

(:get_oauth, :get_lists_members3, "lists/members.json", :Users)

to

(:get_oauth, :get_lists_members3, "lists/members.json", nothing)

You get an object that looks like:

Dict{String,Any} with 6 entries:
  "previous_cursor_str" => "5827030161598877703"
  "users"               => Any[Dict{String,Any}("time_zone"=>nothing,"created_at"=>...
  "total_count"         => nothing
  "previous_cursor"     => 5827030161598877703
  "next_cursor"         => 5827030161598877703
  "next_cursor_str"     => "5827030161598877703"

where the "users" values looks like what you are after with this function, but Users(JSON.parse(String(r.body))) doesn't read that in properly. I'd do a pull request, but I'm actually not sure how to fix this here.

@c-p-murphy
Copy link

c-p-murphy commented Oct 25, 2020

There seems to be a problem with some of the other list operations too.

julia> get_lists_members_show(slug="Developers", owner_screen_name="Twitter", screen_name="TwitterDev")
ERROR: KeyError: key "members" not found
Stacktrace:
 [1] getindex(::Dict{String,Any}, ::SubString{String}) at ./dict.jl:467
 [2] (::Twitter.var"#2#7")(::String, ::Int64) at /Users/christophermurphy/.julia/dev/Twitter/src/reconnect_logic.jl:36
 [3] (::Twitter.var"#2#7")(::String) at /Users/christophermurphy/.julia/dev/Twitter/src/reconnect_logic.jl:29
 [4] reconnect(::String, ::Int64) at /Users/christophermurphy/.julia/dev/Twitter/src/reconnect_logic.jl:48 (repeats 2 times)
 [5] get_lists_members_show(; kwargs::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:slug, :owner_screen_name, :screen_name),Tuple{String,String,String}}}) at /Users/christophermurphy/.julia/dev/Twitter/src/macrogenerated.jl:91
 [6] top-level scope at none:1

julia> post_lists_members_destroy(slug="Developers", owner_screen_name="Twitter", screen_name="TwitterDev")
ERROR: KeyError: key "lists/members" not found
Stacktrace:
 [1] getindex(::Dict{String,Any}, ::SubString{String}) at ./dict.jl:467
 [2] (::Twitter.var"#2#7")(::String, ::Int64) at /Users/christophermurphy/.julia/dev/Twitter/src/reconnect_logic.jl:36
 [3] (::Twitter.var"#2#7")(::String) at /Users/christophermurphy/.julia/dev/Twitter/src/reconnect_logic.jl:29
 [4] reconnect(::String, ::Int64) at /Users/christophermurphy/.julia/dev/Twitter/src/reconnect_logic.jl:48 (repeats 2 times)
 [5] post_lists_members_destroy(; kwargs::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:slug, :owner_screen_name, :screen_name),Tuple{String,String,String}}}) at /Users/christophermurphy/.julia/dev/Twitter/src/macrogenerated.jl:89
 [6] top-level scope at none:1

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

No branches or pull requests

2 participants