Changeset 7848 for lang/javascript/userscripts
- Timestamp:
- 03/12/08 17:36:39 (5 years ago)
- Files:
-
- 1 modified
-
lang/javascript/userscripts/nicoclip.user.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/nicoclip.user.js
r7644 r7848 197 197 // <link rel="next" href="(.*?)"> を探す 198 198 var links = doc.getElementsByTagName('link'); 199 var linksNum = links.length;200 199 this.nextAtomURL = null; 201 for (var i = 0; i < linksNum; i++) {200 for (var i = links.length; i --> 0; ) { 202 201 if (links[i].getAttribute('rel') == 'next') { 203 202 this.nextAtomURL = links[i].getAttribute('href'); … … 205 204 console.log('next Atom URL: ' + this.nextAtomURL); 206 205 } 206 break; 207 207 } 208 208 } … … 213 213 for (var i = 0; i < entriesNum; i++) { 214 214 var title = (entries[i].getElementsByTagName('title'))[0].firstChild.nodeValue; 215 title = title.replace(/^ニコニコ動画\(.*?\)\s*‐/, ''); // RC2/RC 216 title = title.replace(/‐ニコニコ動画\(.*?\)$/, ''); // RC2 217 title = title.replace(/^ニコニコ動画\(.*?\) \| /, ''); // gamma 218 title = title.replace(/^ニコニコ動画γ \| /, ''); // gamma 215 title = title.replace(/^ニコニコ動画\(.*?\)\s*‐/, ''); // RC2/RC 216 title = title.replace(/‐ニコニコ動画\(.*?\)$/, ''); // RC2 217 title = title.replace(/^ニコニコ動画(?:γ|\(.*?\)) \| /, ''); // gamma 219 218 // あとでcreateTextNodeするのでエンティティを解除 220 219 title = title.replace('<', '<'); … … 335 334 } 336 335 // ユーザー名を取得 337 if (resp.responseText.match(/Hatena .id\s*=\s*'(.*?)'/)) {336 if (resp.responseText.match(/Hatena\.id\s*=\s*'([^']+)'/)) { 338 337 this.hatenaUsername = RegExp.$1; 339 338 } … … 355 354 var datastr = resp.responseText; 356 355 // コメント欄の中身を取得 357 if (datastr.match(/<input [^>]* value="(.*?)"[^>]*id="comment"/)) {356 if (datastr.match(/<input\s+(?:|[^>]+?\s+)value="((?:\\"|[^"])*)"[^>]*? id="comment"/)) { 358 357 var comment = RegExp.$1; 359 358 if (DEBUG) { … … 409 408 } 410 409 // ユーザー名を取得 411 if (datastr.match(/Hatena .id\s*=\s*'(.*?)'/)) {410 if (datastr.match(/Hatena\.id\s*=\s*'([^']+)'/)) { 412 411 this.hatenaUsername = RegExp.$1; 413 412 } … … 425 424 var datastr = resp.responseText; 426 425 // ユーザー名を取得 427 if (datastr.match(/Hatena .id\s*=\s*'(.*?)'/)) {426 if (datastr.match(/Hatena\.id\s*=\s*'([^']+)'/)) { 428 427 this.hatenaUsername = RegExp.$1; 429 428 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)