/site/emacs-w3m/shimbun/sb-msdn.el

https://github.com/AriT93/emacs · Emacs Lisp · 88 lines · 49 code · 18 blank · 21 comment · 0 complexity · f3d269725467b1eaac155788b92b435d MD5 · raw file

  1. ;;; sb-msdn.el --- shimbun backend for MSDN
  2. ;; Copyright (C) 2004, 2005, 2006 Yoichi NAKAYAMA <yoichi@geiin.org>
  3. ;; Author: Yoichi NAKAYAMA <yoichi@geiin.org>
  4. ;; Keywords: news
  5. ;; Created: Sep 14, 2004
  6. ;; This file is a part of shimbun.
  7. ;; This program is free software; you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published by
  9. ;; the Free Software Foundation; either version 2, or (at your option)
  10. ;; any later version.
  11. ;; This program is distributed in the hope that it will be useful,
  12. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;; GNU General Public License for more details.
  15. ;; You should have received a copy of the GNU General Public License
  16. ;; along with this program; if not, you can either send email to this
  17. ;; program's maintainer or write to: The Free Software Foundation,
  18. ;; Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. ;;; Commentary:
  20. ;;; Code:
  21. (require 'shimbun)
  22. (require 'sb-rss)
  23. (luna-define-class shimbun-msdn (shimbun-rss) ())
  24. (defvar shimbun-msdn-group-alist
  25. '(("all" "http://msdn.microsoft.com/rss.xml")
  26. ("netframework" "http://msdn.microsoft.com/netframework/rss.xml")
  27. ("architecture" "http://msdn.microsoft.com/architecture/rss.xml")
  28. ("asp.net" "http://msdn.microsoft.com/asp.net/rss.xml")
  29. ("data" "http://msdn.microsoft.com/data/rss.xml")
  30. ("longhorn" "http://msdn.microsoft.com/longhorn/rss.xml")
  31. ("mobility" "http://msdn.microsoft.com/mobility/rss.xml")
  32. ("subscriptions" "http://msdn.microsoft.com/subscriptions/rss.xml")
  33. ("msdntv" "http://msdn.microsoft.com/msdntv/rss.xml")
  34. ("office" "http://msdn.microsoft.com/office/rss.xml")
  35. ("security" "http://msdn.microsoft.com/security/rss.xml")
  36. ("sql" "http://msdn.microsoft.com/sql/rss.xml")
  37. ("theshow" "http://msdn.microsoft.com/theshow/rss.xml")
  38. ("vbasic" "http://msdn.microsoft.com/vbasic/rss.xml")
  39. ("vcsharp" "http://msdn.microsoft.com/vcsharp/rss.xml")
  40. ("visualc" "http://msdn.microsoft.com/visualc/rss.xml")
  41. ("vfoxpro" "http://msdn.microsoft.com/vfoxpro/rss.xml")
  42. ("vjsharp" "http://msdn.microsoft.com/vjsharp/rss.xml")
  43. ("vstudio" "http://msdn.microsoft.com/vstudio/rss.xml")
  44. ("vs2005" "http://msdn.microsoft.com/vs2005/rss.xml")
  45. ("webservices" "http://msdn.microsoft.com/webservices/rss.xml")
  46. ("embedded" "http://msdn.microsoft.com/embedded/rss.xml")
  47. ("xml" "http://msdn.microsoft.com/xml/rss.xml")
  48. ("japan.msdn" "http://www.microsoft.com/japan/msdn/rss.xml")
  49. ("japan.msdn-us" "http://www.microsoft.com/japan/msdn/aboutmsdn/us/rss.xml"))
  50. "Alist of readable groups and URLs of their RSSs.
  51. List is available at:
  52. http://msdn.microsoft.com/aboutmsdn/rss/
  53. http://www.microsoft.com/japan/msdn/aboutmsdn/rss/")
  54. (defvar shimbun-msdn-from-address "nobody@microsoft.com")
  55. (defvar shimbun-msdn-content-start "\\(<!--\\(pull table\\|BEGIN_CONTENT\\| Begin Content \\)-->\\|<table id=\"hpcontenttable\".*>\\)")
  56. (defvar shimbun-msdn-content-end "\\(</body>\\|<!--\\(END_CONTENT\\| End Content \\)-->\\)")
  57. (luna-define-method shimbun-groups ((shimbun shimbun-msdn))
  58. (mapcar 'car shimbun-msdn-group-alist))
  59. (luna-define-method shimbun-index-url ((shimbun shimbun-msdn))
  60. (nth 1 (assoc (shimbun-current-group shimbun) shimbun-msdn-group-alist)))
  61. (luna-define-method shimbun-rss-process-date ((shimbun shimbun-msdn) date)
  62. date)
  63. (luna-define-method shimbun-article-url ((shimbun shimbun-msdn) header)
  64. (let ((url (shimbun-article-base-url shimbun header)))
  65. (if (string-match "\\`http://msdn\\.microsoft\\.com/\
  66. library/default\\.asp\\?url=\\(.+\\.asp\\)\\'" url)
  67. (concat "http://msdn.microsoft.com" (match-string 1 url))
  68. url)))
  69. (provide 'sb-msdn)
  70. ;;; sb-msdn.el ends here