Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TwitterのList編集しやすいやつ作った

ryonext
May 28, 2016

 TwitterのList編集しやすいやつ作った

ryonext

May 28, 2016
Tweet

More Decks by ryonext

Other Decks in Technology

Transcript

  1. ϝϯόʔͷ࿩ w 3BJMTଆͰϦετͷϝϯόʔΛऔಘ͢Δ"1*Λ࡞੒ 1 class MembersController < ApplicationController … 4

    def index 5 member_id_lists = twitter.list_members(list_id: params[:list_id], owner_id: params[:owner_id], count: 200).map {|m| m.to_h[:id_str] } 6 render json: member_id_lists 7 end … 24 end
  2. w +4ଆͰϦετͷ਺͚ͩϧʔϓΛճͯ͠ɺ7VFKTͷ EBUBͱͯ࣋ͭ͠ 14 fetchMembers: (list) -> 15 this.$http( 16

    method: "GET" 17 url: "/members?list_id=#{list.list.id_str} &owner_id=#{this.currentUserId}" 18 headers: 19 "X-CSRF-Token": $('meta[name="csrf-token"]').attr('content') 20 ).then( (response) -> 21 list.members = response.data 22 ).catch( (err) -> 23 alert("error") 24 ).finally( -> 25 list.completed = true 26 )