stackexchange-favs-to-pinboard

Hex Artifact Content
Login

Artifact 5aeb04db2dedff2d9d5f3f25e4f28ecc3599d1fd74b57c8e3c8f9e4133e72e00:


0000: 23 53 74 61 63 6b 45 78 63 68 61 6e 67 65 20 46  #StackExchange F
0010: 61 76 6f 75 72 69 74 65 73 20 74 6f 20 50 69 6e  avourites to Pin
0020: 62 6f 61 72 64 0a 0a 49 6d 70 6f 72 74 20 61 6c  board..Import al
0030: 6c 20 79 6f 75 72 20 53 74 61 63 6b 45 78 63 68  l your StackExch
0040: 61 6e 67 65 20 73 69 74 65 20 28 53 74 61 63 6b  ange site (Stack
0050: 6f 76 65 72 66 6c 6f 77 2c 20 53 75 70 65 72 20  overflow, Super 
0060: 55 73 65 72 2c 20 43 72 6f 73 73 20 56 61 6c 69  User, Cross Vali
0070: 64 61 74 65 64 2c 20 65 74 63 29 20 66 61 76 6f  dated, etc) favo
0080: 75 72 69 74 65 73 20 74 6f 20 50 69 6e 62 6f 61  urites to Pinboa
0090: 72 64 2e 20 42 65 63 61 75 73 65 20 61 6d 61 7a  rd. Because amaz
00a0: 69 6e 67 6c 79 20 6e 6f 2d 6f 6e 65 20 65 6c 73  ingly no-one els
00b0: 65 20 73 65 65 6d 73 20 74 6f 20 68 61 76 65 20  e seems to have 
00c0: 64 6f 6e 65 20 74 68 69 73 2e 20 41 6e 64 20 79  done this. And y
00d0: 65 73 2c 20 74 68 69 73 20 69 73 20 68 6f 77 20  es, this is how 
00e0: 49 20 77 72 69 74 65 20 52 75 62 79 20 63 6f 64  I write Ruby cod
00f0: 65 2c 20 74 61 62 73 20 61 73 20 77 65 6c 6c 20  e, tabs as well 
0100: 2d 20 69 66 20 79 6f 75 20 74 68 69 6e 6b 20 74  - if you think t
0110: 68 69 73 20 69 73 20 62 61 64 20 73 74 79 6c 65  his is bad style
0120: 20 79 6f 75 20 73 68 6f 75 6c 64 20 73 65 65 20   you should see 
0130: 6d 79 20 48 61 73 6b 65 6c 6c 2e 0a 0a 23 23 54  my Haskell...##T
0140: 6f 20 55 73 65 0a 0a 52 75 6e 20 60 72 75 62 79  o Use..Run `ruby
0150: 20 2f 70 61 74 68 2f 74 6f 2f 73 74 61 63 6b 65   /path/to/stacke
0160: 78 63 68 61 6e 67 65 2d 66 61 76 73 2d 74 6f 2d  xchange-favs-to-
0170: 70 69 6e 62 6f 61 72 64 2e 72 62 20 2d 69 20 53  pinboard.rb -i S
0180: 74 61 63 6b 45 78 63 68 61 6e 67 65 49 44 20 2d  tackExchangeID -
0190: 74 20 50 69 6e 62 6f 61 72 64 41 50 49 54 6f 6b  t PinboardAPITok
01a0: 65 6e 60 20 0a 0a 59 6f 75 20 63 61 6e 20 67 65  en` ..You can ge
01b0: 74 20 79 6f 75 72 20 50 69 6e 62 6f 61 72 64 20  t your Pinboard 
01c0: 41 50 49 20 74 6f 6b 65 6e 20 6f 6e 20 79 6f 75  API token on you
01d0: 72 20 70 61 73 73 77 6f 72 64 20 74 61 62 20 6f  r password tab o
01e0: 66 20 74 68 65 20 73 65 74 74 69 6e 67 73 20 70  f the settings p
01f0: 61 67 65 2e 20 59 6f 75 72 20 53 74 61 63 6b 45  age. Your StackE
0200: 78 63 68 61 6e 67 65 20 49 44 2c 20 69 73 20 77  xchange ID, is w
0210: 68 61 74 20 79 6f 75 20 67 65 74 20 77 68 65 6e  hat you get when
0220: 20 6c 6f 67 67 65 64 20 69 6e 20 74 6f 20 73 74   logged in to st
0230: 61 63 6b 65 78 63 68 61 6e 67 65 2e 63 6f 6d 20  ackexchange.com 
0240: 69 74 73 65 6c 66 20 2d 20 74 68 69 73 20 69 73  itself - this is
0250: 20 70 72 6f 62 61 62 6c 79 20 64 69 66 66 65 72   probably differ
0260: 65 6e 74 20 66 72 6f 6d 20 79 6f 75 72 20 53 74  ent from your St
0270: 61 63 6b 6f 76 65 72 66 6c 6f 77 20 49 44 2c 20  ackoverflow ID, 
0280: 65 74 63 2e 0a 0a 53 69 6e 63 65 20 69 74 20 64  etc...Since it d
0290: 6f 65 73 20 6e 6f 74 20 6f 76 65 72 77 72 69 74  oes not overwrit
02a0: 65 20 65 78 69 73 74 69 6e 67 20 62 6f 6f 6b 6d  e existing bookm
02b0: 61 72 6b 73 20 79 6f 75 20 63 61 6e 20 73 61 66  arks you can saf
02c0: 65 6c 79 20 72 75 6e 20 69 74 20 65 76 65 72 79  ely run it every
02d0: 20 73 6f 20 6f 66 74 65 6e 20 74 6f 20 62 72 69   so often to bri
02e0: 6e 67 20 69 6e 20 6e 65 77 20 6f 6e 65 73 2e 20  ng in new ones. 
02f0: 0a 0a 23 23 52 65 71 75 69 72 65 6d 65 6e 74 73  ..##Requirements
0300: 0a 0a 4e 6f 77 74 20 62 65 79 6f 6e 64 20 52 75  ..Nowt beyond Ru
0310: 62 79 2e 20 49 20 61 6d 20 61 77 61 72 65 20 74  by. I am aware t
0320: 68 65 72 65 20 61 72 65 20 47 65 6d 73 20 66 6f  here are Gems fo
0330: 72 20 53 74 61 63 6b 45 78 63 68 61 6e 67 65 2c  r StackExchange,
0340: 20 62 75 74 20 6d 6f 73 74 20 6f 66 20 74 68 65   but most of the
0350: 6d 20 73 65 65 6d 20 74 6f 20 61 73 73 75 6d 65  m seem to assume
0360: 20 79 6f 75 20 61 72 65 20 74 61 72 67 65 74 69   you are targeti
0370: 6e 67 20 6a 75 73 74 20 6f 6e 65 20 73 69 74 65  ng just one site
0380: 20 28 53 74 61 63 6b 6f 76 65 72 66 6c 6f 77 29   (Stackoverflow)
0390: 2c 20 6e 6f 74 20 61 6e 79 2f 61 6c 6c 20 53 74  , not any/all St
03a0: 61 63 6b 45 78 63 68 61 6e 67 65 20 73 69 74 65  ackExchange site
03b0: 73 20 79 6f 75 20 6d 61 79 20 75 73 65 2e 20 54  s you may use. T
03c0: 68 65 72 65 20 69 73 20 61 6c 73 6f 20 61 74 20  here is also at 
03d0: 6c 65 61 73 74 20 6f 6e 65 20 72 65 61 6c 6c 79  least one really
03e0: 20 67 6f 6f 64 20 47 65 6d 20 66 6f 72 20 50 69   good Gem for Pi
03f0: 6e 62 6f 61 72 64 2c 20 62 75 74 20 69 74 20 6a  nboard, but it j
0400: 75 73 74 20 73 65 65 6d 65 64 20 6f 76 65 72 6b  ust seemed overk
0410: 69 6c 6c 20 66 6f 72 20 74 68 65 20 6f 6e 65 20  ill for the one 
0420: 41 50 49 20 66 75 6e 63 74 69 6f 6e 20 49 20 77  API function I w
0430: 61 6e 74 65 64 20 74 6f 20 75 73 65 2c 20 70 6c  anted to use, pl
0440: 75 73 20 49 20 64 6f 6e 27 74 20 74 68 69 6e 6b  us I don't think
0450: 20 69 74 20 72 61 74 65 20 6c 69 6d 69 74 73 2e   it rate limits.
0460: 0a                                               .