Comments (4)
Makes sense.
I figured it had something to do with the token but I was trying to use their http://gyo.tc/ to submit URLs and I didn't realize the importance of the cookies.
Thank you for the code. I was able to fairly easily add it as a custom handler in archivenow.
:-)
from archivenow.
I have tried to push several different pages to Megalodon.jp and found that the archive does not accept most of non-Japanese pages, so I am not sure if I am going to add it to ArchiveNow.
But if you want to add Megalodon.jp to your own copy of ArchiveNow or use a separate Python script, here is the Python code that can push pages to Megalodon.jp:
import requests
# an example page to be pushed into the archive
uri = 'http://jp-australia.com/2019/intro/'
r = requests.get('http://megalodon.jp/?url='+uri)
token = str(r.content).split('"token" value="',1)[1].split('"',1)[0]
cookies = dict(PHPSESSID=r.headers['Set-Cookie'].split('PHPSESSID=',1)[1].split(';',1)[0])
r2 = requests.post('http://megalodon.jp/pc/get_simple/decide',
data={"url":uri, "token":token},
cookies=cookies)
print 'The URI to the archived page :', str(r2.content).split('location.href = "',1)[1].split('"',1)[0]
from archivenow.
@maturban I didn't put the whole fork up here, but here is a Gist of the two files I modified.
The first file is a patch file of the differences I made to index.html and the second file is the handler I wrote.
https://gist.github.com/myano/88dfdb4fea27bb632293e107a663998a
from archivenow.
Perfect. Is your code available on Github?
from archivenow.
Related Issues (20)
- Archive Web Site HOT 4
- Archive images in IA HOT 9
- bug(windows): Error: No enabled archive handler found HOT 2
- Archiving resources with relative Content-Location HOT 2
- Webcitation is currently not accepting archiving requests. HOT 2
- 502 bad gateway error HOT 1
- via.hypothes.is nesting
- Alternate archive.today URLs
- ImportError: No module named pathlib HOT 1
- Problems with pushing mementos into Internet Archive HOT 6
- pypi project "archivenow" links to maturban/archivenow instead of here
- How to set proxy for it ?
- archivenow --ia "http://www.hotcactus.nyc/" returns incorrect URL HOT 1
- Will submit pr: submit ghostarchive.org
- archive.today fails, the site presents a captcha challenge
- Some Questions to consider
- Add archivo.pt as a source for URI submission
- [Feature request] Add retry logic
- How to fetch the original URL from the snapshopt?
- Docker and archive.today
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archivenow.