Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix issues for Culture Shock, and add it

  • Loading branch information...
commit 37943473ebb7bbbd41bd487d5e1780f2944a6aae 1 parent 0794c74
Tom Parker authored

Showing 2 changed files with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. +2 2 fanfiction.py
  2. +9 1 series.txt
4 fanfiction.py
@@ -8,7 +8,7 @@
8 8 data = cache.get(url).read()
9 9 open("dump", "wb", "utf-8").write(data)
10 10
11   -title = re.search("<title>(.+?) Chapter \d+: .+?(, a .+? fanfic)", data)
  11 +title = re.search("<title>(.+?) Chapter \d+, a", data)
12 12 title = title.groups()
13 13 author = re.search("Author: <a href='/u/\d+/[^']+'>([^<]+)</a>", data)
14 14 author = author.groups()[0]
@@ -24,6 +24,6 @@
24 24 titlePattern: "%s (.+?), a"
25 25 startPage: "http://www.fanfiction.net/s/%s/1/%s"
26 26 contentPattern: "<div class='storytext xcontrast_txt' id='storytext'>(.+?)</div>(.*?)</div><div style='height:5px'>"
27   - nextPattern: "Value='&nbsp;Next &gt;&nbsp;' onClick=\"self.location='([^']+)"
  27 + nextPattern: "Value='&nbsp;Next &gt;&nbsp;' onClick=\\\"self.location='([^']+)"
28 28 }"""%(title[0].replace(" ",""), title[0], author, title[0], id, name)
29 29
10 series.txt
@@ -51,4 +51,12 @@ series {
51 51 contentPattern: "<div class='storytext xcontrast_txt' id='storytext'>(.+?)</div>(.*?)</div><div style='height:5px'>"
52 52 nextPattern: "Value='&nbsp;Next &gt;&nbsp;' onClick=\"self.location='([^']+)"
53 53 }
54   -
  54 +series {
  55 + name: "CultureShock"
  56 + description: "Culture Shock"
  57 + author: "Ruskbyte"
  58 + titlePattern: "Culture Shock (.+?), a"
  59 + startPage: "http://www.fanfiction.net/s/3983128/1/Culture-Shock"
  60 + contentPattern: "<div class='storytext xcontrast_txt' id='storytext'>(.+?)</div>(.*?)</div><div style='height:5px'>"
  61 + nextPattern: "Value='&nbsp;Next &gt;&nbsp;' onClick=\"self.location='([^']+)"
  62 +}

0 comments on commit 3794347

Please sign in to comment.
Something went wrong with that request. Please try again.