Last active
October 28, 2023 09:13
-
-
Save gaomd/7da5de92561dbd0c6b44 to your computer and use it in GitHub Desktop.
Revisions
-
gaomd revised this gist
Oct 5, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ // // This scripts helps you migrating V2EX's starred topics to Pinboard // https://www.v2ex.com/t/137169 // // 0. Edit authToken variable below. // 1. Navigate to https://www.v2ex.com/my/topics -
gaomd revised this gist
Oct 5, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,14 +3,14 @@ // // 0. Edit authToken variable below. // 1. Navigate to https://www.v2ex.com/my/topics // 2. Paste code into browser console, and enter to execute // 3. You should see the console scroll over some outputs // 4. Wait for the "DONE :)" message // 5. Move to the next page, and continue step 1 // // Head over to https://pinboard.in/api for more parameters. // // Get your Auth Token from: https://pinboard.in/settings/password var authToken = "username:random-token"; // Tags may be separated by comma? (untested) var tags = "v2ex"; -
gaomd created this gist
Oct 5, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ // // This scripts helps you migrating V2EX's starred topics to Pinboard // // 0. Edit authToken variable below. // 1. Navigate to https://www.v2ex.com/my/topics // 2. Paste code into browser console, and enter to exctute // 3. You should see the console scroll over some some outputs // 4. Wait for the "DONE :)" message // 5. Move to the next page, and continue step 1 // // Head over to https://pinboard.in/api for more parameters. // // Get Auth Token from: https://pinboard.in/settings/password var authToken = "username:random-token"; // Tags may be separated by comma? (untested) var tags = "v2ex"; var index = 0; function add(url) { var img = new Image(); img.src = url; } $(".item_title a").each(function() { var url = "https://api.pinboard.in/v1/posts/add?auth_token=" + authToken + "&tags=" + tags + "&url=https://www.v2ex.com" + $(this).attr("href").split("#")[0] + "&description=" + $(this).text(); // Timeout 4000 cuz Pinboard have rate limit of 3s per request setTimeout(function() { add(url) }, index++ * 4000); }) setTimeout(function() { alert("DONE :)"); }, index * 4000);