그리스몽키에 관한 질문입니다.

lovethecorners의 이미지

이곳에서도 많은 분들이 그리스몽키에대해 말씀을 하셨지만, 읽기싫은 ID정도만 차단할수있는줄 알았습니다...-_-;
그런데, 신기(?)하게도 web site를 변형시킬수도 있는것같습니다. 그래서 질문드리는데요, 만약에 자주가는 사이트에서 필요한 메뉴만 보이게도 가능할것 같은생각이 듭니다.

무슨말이냐면 예를 들어,

test    test1    test2    test3

매인 메뉴가있고 각각 매인 메뉴에는 드롭다운 형식의 서브 메뉴들이있습니다. 그 사이트 방문할때마다 아래와 같이 "test2" 매인메뉴는 않보이게도 할수있을것 같은데...어떤식으로 접근을 해야할지를 모르겠습니다. 어떤식으로 code를 작성해 나가야하는 말씀해주시면 감사하겠습니다.

test    test1    test3

Prentice의 이미지

http://userscripts.org/scripts/show/10024

XPath 조회 후 삭제하시면 됩니다. 저는 copy-and-paste로 작성했기 때문에 자세한 내용은 패스하겠습니다.

lovethecorners의 이미지

댓글 감사합니다. 후...그런데 링크 사이트 방문후에는 우울해지네요. 무슨 말인지 몰라서요....-_-;

delall("//*[@class='usermenu']/a[@href='http://www.egloos.com'] | 
//*[@class='usermenu']/a[@href='http://www.egloos.com/'] | 
//*[@class='USERMENU']/a[@href='http://www.egloos.com'] | 
//*[@class='USERMENU']/a[@href='http://www.egloos.com/']");

간단하게나마, 해석좀 부탁드려도될까요?

==
more than one way to do it
말로만 블로거: http://miniz.tistory.com

Prentice의 이미지

XML, XPath에 대해 검색해보시면 자세히 나올 듯 합니다.

특정 태그에 특정 속성이 걸려있고 특정한 태그를 또 자식으로 가지는 경우 등을 검사하여 삭제하는 것입니다.

네가지를 삭제하기 위해 delall()을 네 번 쓰지 않고, 네가지 경우에 대해 '|' 연산자의 합집합(or?) 기능을 사용하였습니다.

lovethecorners의 이미지

넵, 감사합니다. 한번 연구해보도록 하겠습니다.
==
more than one way to do it
말로만 블로거: http://miniz.tistory.com

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.