This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See https://github.com/docker-library/mongo/pull/63 | |
docker run --rm --volumes-from my-mongo-server mongo unlink "/data/db/mongod.lock" | |
docker run --rm --volumes-from my-mongo-server mongo --repair |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here you choose the base Docker image for the actor. Apify provides the following images: | |
# apify/actor-node-basic | |
# apify/actor-node-chrome | |
# apify/actor-node-puppeteer | |
# However, you can use any other image from Docker Hub. | |
# For more information, see https://apify.com/docs/actor#base-images | |
FROM apify/actor-node-basic | |
# Copy all files and directories from the directory to the Docker image | |
COPY . ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="page-content"> | |
<h4>2016-11-24</h4> | |
<ul> | |
<li>Web: Added a new feature ... </li> | |
</ul> | |
<h4>2016-11-09</h4> | |
<ul> | |
<li>General: Increased the length limit ...</li> | |
<li>Web: Showing more relevant statistics ...</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> | |
<channel> | |
<title>Apifier_Release_Notes</title> | |
<link>...</link> | |
<description>...</description> | |
<generator>Apifier - Crawler #1</generator> | |
<lastBuildDate>Sun, 06 Sep 2009 16:20:00 UTC</lastBuildDate> | |
<item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pageFunction(context) { | |
var $ = context.jQuery; | |
// All h4 headings containing date - <h4>2016-11-24</h4> | |
var headings = $('.page-content h4'); | |
// All descriptions - <ul><li>General: ...</li>...</ul> | |
var lists = $('.page-content ul'); | |
// Iterate thru all release notes | |
var result = []; | |
for (var i = 0; i < headings.length; i ++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"https://github.com/apas/athena": 100, | |
"https://github.com/achillesrasquinha/bulbea": 99, | |
"https://keratin.tech": 98, | |
"https://github.com/dhruvio/js_express-parser-combinators": 97, | |
"https://www.pagedash.com/": 96, | |
"https://github.com/monostream/tifig": 95, | |
"https://javalin.io/news/javalin-1.0.0-stable.html": 94, | |
"http://www.goodoldweb.com/": 93, | |
"http://vuemc.io": 92, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pageFunction(context) { | |
var $ = context.jQuery | |
var posts = $('.athing').toArray(); // All posts as array of DOM elements | |
var $moreLink = $('.morelink'); // Link to next page | |
// If crawler is scraping 2nd, 3rd, ... page then | |
// context.request.referrer.pageFunctionResult contains | |
// result from previous pages. | |
var prevResult = context.request.referrer | |
? context.request.referrer.pageFunctionResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get private key | |
openssl pkcs12 -in yourP12File.pfx -nocerts -out privateKey.pem | |
# Get public key | |
openssl pkcs12 -in yourP12File.pfx -clcerts -nokeys -out publicCert.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const { APIFY_CONTAINER_PORT, APIFY_CONTAINER_URL } = process.env; | |
const app = express() | |
app.get('/', (req, res) => { | |
res.send('Hello World!'); | |
}); | |
app.listen(APIFY_CONTAINER_PORT, () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Apify = require('apify'); | |
Apify.main(async () => { | |
// Get queue and enqueue first url. | |
const requestQueue = await Apify.openRequestQueue(); | |
const enqueue = async url => requestQueue.addRequest(new Apify.Request({ url })); | |
await enqueue('https://news.ycombinator.com/'); | |
// Create crawler. | |
const crawler = new Apify.PuppeteerCrawler({ |
NewerOlder