Skip to content

Commit

Permalink
Merge pull request #18 from KebabLord/master
Browse files Browse the repository at this point in the history
updating old domain to 8kun
  • Loading branch information
antonizoon authored Sep 26, 2020
2 parents d6a6a05 + 1c6a795 commit 112216f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Usage
.. code:: python
import py8chan
b = py8chan.Board('b')
thread = b.get_thread(423491034)
board = py8chan.Board('v')
thread = board.get_thread(423491034)
print(thread)
Expand Down
4 changes: 2 additions & 2 deletions docs/library/board.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Here is a sample application that grabs and uses Board information::
from __future__ import print_function
import py8chan

board = py8chan.Board('tg')
board = py8chan.Board('tech')
thread_ids = board.get_all_thread_ids()
str_thread_ids = [str(id) for id in thread_ids] # need to do this so str.join below works
print('There are', len(all_ids), 'active threads on /tg/:', ', '.join(str_thread_ids))
print('There are', len(thread_ids), 'active threads on /tech/:', ', '.join(str_thread_ids))

Basic Usage
-----------
Expand Down
7 changes: 4 additions & 3 deletions docs/library/post.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ Here is a sample application that grabs and prints :class:`py8chan.Thread` and :
# print topic post information
topic = thread.topic
image = topic.first_file
print('Topic Repr', topic)
print('Postnumber', topic.post_number)
print('Timestamp', topic.timestamp)
print('Datetime', repr(topic.datetime))
print('Filemd5hex', topic.file_md5_hex)
print('Fileurl', topic.file_url)
print('Subject', topic.subject)
print('Comment', topic.comment)
print('Thumbnailurl', topic.thumbnail_url)
print('Filemd5hex', image.file_md5_hex)
print('Fileurl', image.file_url)
print('Thumbnailurl', image.thumbnail_url)
Basic Usage
-----------
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here's a short code snippet of us printing out how many threads are active on a
board = py8chan.Board('v')
thread_ids = board.get_all_thread_ids()
str_thread_ids = [str(id) for id in thread_ids] # need to do this so str.join below works
print('There are', len(all_ids), 'active threads on /tg/:', ', '.join(str_thread_ids))
print('There are', len(thread_ids), 'active threads on /v/:', ', '.join(str_thread_ids))


Threads
Expand Down
2 changes: 1 addition & 1 deletion examples/example2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# credits to Anarov for improved example.py
from __future__ import print_function
import py8chan
import py8chan,sys

def main():
if len(sys.argv) != 3:
Expand Down
4 changes: 2 additions & 2 deletions examples/example3.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# credits to Anarov for improved example.py
import py8chan

b = py8chan.Board('b')
threads = b.get_threads()
board = py8chan.Board('v')
threads = board.get_threads()
print("Got %i threads" % len(threads))
first_thread = threads[0]
print("First thread: %r" % first_thread)
Expand Down
26 changes: 13 additions & 13 deletions py8chan/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ class Url(object):
def __init__(self, board, https=False):
self._board = board
self._protocol = 'https://' if https else 'http://'
self._site_url = "8ch.net"
self._site_url = "8kun.top"

# Examples
# Site - http://8ch.net/
# Board (HTML) - http://8ch.net/newspaper/
# Thread (HTML) - http://8ch.net/newspaper/res/30.html
# Thread (JSON) - http://8ch.net/newspaper/res/30.html
# Site - http://8kun.top/
# Board (HTML) - http://8kun.top/newspaper/
# Thread (HTML) - http://8kun.top/newspaper/res/30.html
# Thread (JSON) - http://8kun.top/newspaper/res/30.html
#
# Page (JSON) - http://8ch.net/newspaper/1.json
# List (JSON) - http://8ch.net/newspaper/threads.json
# Catalog (JSON) - http://8ch.net/newspaper/catalog.json
# Page (JSON) - http://8kun.top/newspaper/1.json
# List (JSON) - http://8kun.top/newspaper/threads.json
# Catalog (JSON) - http://8kun.top/newspaper/catalog.json
#
# Image (old) - https://8ch.net/newspaper/src/1421068790600.jpg
# Thumb (old) - https://8ch.net/newspaper/thumb/1421068790600.jpg
# Image (new) - https://media.8ch.net/file_store/bf2f563fe4394ee60e5288b1193c87e40c54f3fb57894db3b141b88b9e79ca7c.jpg
# Thumb (new) - https://media.8ch.net/file_store/thumb/bf2f563fe4394ee60e5288b1193c87e40c54f3fb57894db3b141b88b9e79ca7c.jpg
# Image (old) - https://8kun.top/newspaper/src/1421068790600.jpg
# Thumb (old) - https://8kun.top/newspaper/thumb/1421068790600.jpg
# Image (new) - https://media.8kun.top/file_store/bf2f563fe4394ee60e5288b1193c87e40c54f3fb57894db3b141b88b9e79ca7c.jpg
# Thumb (new) - https://media.8kun.top/file_store/thumb/bf2f563fe4394ee60e5288b1193c87e40c54f3fb57894db3b141b88b9e79ca7c.jpg
#
# Static - http://8ch.net/static/blank.gif
# Static - http://8kun.top/static/blank.gif

# API URL Subdomains
DOMAIN = {
Expand Down

0 comments on commit 112216f

Please sign in to comment.