GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — after modification. mp3 and docs can be installed in home directory · Xu-Guo/python@f628b0a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • spider
    • downloadFile.pyc
    • downloadFile.py
    • science60Contents.pyc
    • science60Contents.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎spider/downloadFile.py‎

Copy file name to clipboardExpand all lines: spider/downloadFile.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
import urllib2
66
import time
77
import os
8+
from os.path import expanduser
89
import sys
910

1011

1112
class DownloadFile(object):
1213

14+
home = expanduser("~")
1315
subfolder = time.strftime('%Y%m%d') + "download/"
1416

15-
def __init__(self, filename, url, based='~/Music/'):
16-
self.dictionary = based + DownloadFile.subfolder
17+
def __init__(self, filename, url, based='/Music/'):
18+
self.dictionary = DownloadFile.home + based + DownloadFile.subfolder
19+
# self.dictionary = based + DownloadFile.subfolder
1720
# if directory does not exist, create a new one
1821
if(not os.path.exists(self.dictionary)):
1922
os.makedirs(self.dictionary, 0755)
Collapse file

‎spider/downloadFile.pyc‎

Copy file name to clipboard
100 Bytes
Binary file not shown.
Collapse file

‎spider/science60Contents.py‎

Copy file name to clipboardExpand all lines: spider/science60Contents.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
import time
99
import os
1010
from bs4 import BeautifulSoup
11+
from os.path import expanduser
1112
import re
1213

1314

1415
class Content(object):
1516

1617
subfolder = "doc_" + time.strftime('%Y%m%d') + "download/"
18+
home = expanduser("~")
1719
"""docstring for content"""
1820

19-
def __init__(self, filename='default.txt', url='', based='~/Music/'):
21+
def __init__(self, filename='default.txt', url='', based='/Music/'):
2022
self.url = url
2123
self.user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
2224
self.headers = {'User-Agent': self.user_agent}
23-
self.dictionary = based + Content.subfolder
25+
self.dictionary = Content.home + based + Content.subfolder
2426

2527
# if directory does not exist, create a new one
2628
if(not os.path.exists(self.dictionary)):
Collapse file

‎spider/science60Contents.pyc‎

Copy file name to clipboard
100 Bytes
Binary file not shown.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.