https://github.com/asukaminato0721/python-www
Inspired by proxy-www
https://github.com/asukaminato0721/python-www
Last synced: 2 months ago
JSON representation
Inspired by proxy-www
- Host: GitHub
- URL: https://github.com/asukaminato0721/python-www
- Owner: asukaminato0721
- Created: 2021-02-24T13:24:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-24T16:32:11.000Z (over 4 years ago)
- Last Synced: 2025-04-02T12:53:30.897Z (3 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-www
Inspired by [justjavac/proxy-www](https://github.com/justjavac/proxy-www)
```py
from typing import Callable
import requestsclass WWW:
def __init__(self, name: str = "http://www"):
self.name = namedef __repr__(self):
return repr(self.name)def get(self, *args: Callable):
res = requests.get(self.name)
for f in args:
f(res)def __getattr__(self, name):
return WWW(f"{self.name}.{name}")www = WWW()
www.example.com.get(
lambda x: print(x.status_code),
lambda x: print(x.headers["content-type"]),
)
```Just for fun😉