Categories
Mastering Development

REACT-NATIVE: Images appear when uploaded but stop appearing at one point

I’m coding a React-Native app with expo where users can upload pictures from their camera roll. I successfully retrieve the uri of the image and it appears on the screen, it even appears when I call it on different pages from the database. The problem is that when I log out for a while and […]

Categories
Mastering Development

issue with puppeteer console.log

i just want to use XPath to get innerText using Puppeteer. This is code import * as puppeteer from ‘puppeteer-core’; (async () => { // Make the browser visible by default, extend the timeout, and set a default viewport size const browser = await puppeteer.launch({ executablePath: ‘C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe’, userDataDir: ‘C:\\ctvbanhang\\browserData’, defaultViewport: { width: 1920, […]

Categories
Development

Unexpected token G in JSON at position 0 video-length

I am using video-length to get duration of video in nodejs. The code worked fine in Centos. In Ubuntu 16.x it is showing error: SyntaxError: Unexpected token G in JSON at position 0 at JSON.parse (<anonymous>) at VideoLength (/…/node_modules/video-length/video-length.js:14:24) I have used below code to get duration: const VideoLength = require(‘video-length’); VideoLength(video, { bin: ‘/usr/bin/mediainfo’, […]

Categories
Development

How to get puppeteer working in Google Cloud Run/Cloud Build?

I have a docker image containing a puppeteer web scraper. It works perfectly in my local machine when I build and run it. It also build fine in cloud build, deploys to cloud run and starts the http server. However, when I run one of the cron jobs dealing with a puppeteer instance, it times […]

Categories
Development

How to find string in .txt file using regex? [on hold]

I would like to find: 9ozrhtdy1uq31 in this single line text file: [{“kind”: “Listing”, “data”: {“modhash”: “”, “dist”: 1, “children”: [{“kind”: “t3”, “data”: {“approved_at_utc”: null, “subreddit”: “blackmagicfuckery”, “selftext”: “”, “user_reports”: [], “saved”: false, “mod_reason_title”: null, “gilded”: 0, “clicked”: false, “title”: “Electron-filled acrylic cylinder at my work. Sorry for the dark video”, “link_flair_richtext”: [], “subreddit_name_prefixed”: “r/blackmagicfuckery”, […]

Categories
Development

How to find string in .txt file and set part of that string as a variable?

I would like to find: {“reddit_video”: {“fallback_url”: “https://v.redd.it/9ozrhtdy1uq31/DASH_1080?source=fallback” in this single line text file: [{“kind”: “Listing”, “data”: {“modhash”: “”, “dist”: 1, “children”: [{“kind”: “t3”, “data”: {“approved_at_utc”: null, “subreddit”: “blackmagicfuckery”, “selftext”: “”, “user_reports”: [], “saved”: false, “mod_reason_title”: null, “gilded”: 0, “clicked”: false, “title”: “Electron-filled acrylic cylinder at my work. Sorry for the dark video”, “link_flair_richtext”: [], […]