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
from PyPDF2 import PdfFileWriter, PdfFileReader | |
page = PdfFileReader('original.pdf') | |
secondHalf = PdfFileReader('original.pdf') | |
output = PdfFileWriter() | |
numPages = page.getNumPages() | |
print ("document has %s pages." % numPages) | |
for i in range(numPages): | |
page_data = page.getPage(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
from selenium import webdriver | |
from webdriver_manager.chrome import ChromeDriverManager | |
from selenium.common.exceptions import TimeoutException | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.by import By | |
import time | |
from bs4 import BeautifulSoup |
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
{ | |
"product_name":"Apple iPhone 11 (White, 64 GB)", | |
"product_link":"https://www.flipkart.com/apple-iphone-11-white-64-gb/p/itm2644c3764fc54?pid=MOBFKCTSHAWGGFHM&lid=LSTMOBFKCTSHAWGGFHMCPQSMX&marketplace=FLIPKART&srno=s_1_4&otracker=AS_QueryStore_OrganicAutoSuggest_1_9_na_na_ps&otracker1=AS_QueryStore_OrganicAutoSuggest_1_9_na_na_ps&fm=organic&iid=505d8cab-debd-4157-8157-c6c910875182.MOBFKCTSHAWGGFHM.SEARCH&ssid=cie4w1suy80000001601195482047&qH=7b7504afcaf2e1ea", | |
"product_price":"₹61,990", | |
"product_description":"Beautiful DesignFeaturing a 15.49-cm (6.1) all-screen Liquid Retina LCD and a glass and aluminum design, the iPhone 11 is as beautiful as it gets. Also, the IP68 rating ensures that is water-resistant up to 2 meters for 30 minutes.\n", | |
"product_rating":"4.7", | |
"review_comment":"Amazing phone with great cameras and better battery which gives you the best performance. I just love the camera .READ MORE" | |
} |
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
require("dotenv").config(); | |
const amqp = require("amqplib/callback_api"); | |
const { getPosts } = require("./firerequest"); | |
amqp.connect("amqp://" + process.env.RABBITMQ_URL, (err, conn) => { | |
conn.createChannel((err, ch) => { | |
var ex = "posts"; | |
ch.assertExchange(ex, "fanout", { durable: false }); |
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 axios = require("axios"); | |
const getPosts = async url => { | |
return new Promise((resolve, reject) => { | |
axios | |
.get(url) | |
.then(result => resolve(result.data)) | |
.catch(error => reject(error)); | |
}); | |
}; |
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
require("dotenv").config(); | |
const amqp = require("amqplib/callback_api"); | |
amqp.connect("amqp://" + process.env.RABBITMQ_URL, function(err, conn) { | |
conn.createChannel(function(err, ch) { | |
var ex = "posts"; | |
ch.assertExchange(ex, "fanout", { durable: false }); | |
ch.assertQueue("", { exclusive: true }, function(err, q) { |
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
require("dotenv").config(); | |
const amqp = require("amqplib/callback_api"); | |
amqp.connect("amqp://" + process.env.RABBITMQ_URL, function(err, conn) { | |
if (err) { | |
console.log("error", err); | |
} else { | |
const url = "https://jsonplaceholder.typicode.com"; | |
conn.createChannel(function(err, ch) { | |
for (let postIndex = 1; postIndex < 15; postIndex++) { |
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
from datetime import datetime | |
from random import randrange | |
from sqlalchemy import DECIMAL, Column, DateTime, Integer, MetaData, String | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import relationship, sessionmaker | |
from connection import conn | |
Base = declarative_base() |
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
Host o.Development.server.digitalocean | |
User root | |
Hostname 209.97.171.74 |
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
import { Response, Request } from "express"; | |
import { Job, DoneCallback } from "kue"; | |
import axios from "axios"; | |
const kue = require("kue"); | |
const express = require("express"); | |
const app = express(); | |
const port = 3000; | |
const queue = kue.createQueue(); |
NewerOlder