{"id":633242,"date":"2023-04-21T09:55:50","date_gmt":"2023-04-21T14:55:50","guid":{"rendered":"https:\/\/news.sellorbuyhomefast.com\/index.php\/2023\/04\/21\/saving-instagram-images-automatically-every-hour-with-node-js-or-php\/"},"modified":"2023-04-21T09:55:50","modified_gmt":"2023-04-21T14:55:50","slug":"saving-instagram-images-automatically-every-hour-with-node-js-or-php","status":"publish","type":"post","link":"https:\/\/newsycanuse.com\/index.php\/2023\/04\/21\/saving-instagram-images-automatically-every-hour-with-node-js-or-php\/","title":{"rendered":"Saving Instagram images automatically every hour with Node.js or PHP"},"content":{"rendered":"<div data-target=\"readme-toc.content\">\n<article itemprop=\"text\">\n<h2 tabindex=\"-1\" dir=\"auto\">Sniffagrammers<\/h2>\n<p dir=\"auto\">\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/user-images.githubusercontent.com\/6490641\/232155875-ce2ea2ec-eeb5-4bcc-9af7-8c8d82887420.svg\"><img decoding=\"async\" src=\"https:\/\/user-images.githubusercontent.com\/6490641\/232155875-ce2ea2ec-eeb5-4bcc-9af7-8c8d82887420.svg\" alt=\"logo\"><\/a>\n<\/p>\n<h3 tabindex=\"-1\" dir=\"auto\">In this repo you can find Node.js and PHP files to automatically downloading pictures from instagram by <a href=\"https:\/\/orsi.me\/sniffagram\" rel=\"nofollow\">https:\/\/orsi.me\/sniffagram<\/a><\/h3>\n<hr>\n<h2 tabindex=\"-1\" dir=\"auto\">Prerequisites<\/h2>\n<p dir=\"auto\">Just a <strong>web space<\/strong> where to execute a Node.js script.. or PHP script; alternatively you can run the script on your computer.<\/p>\n<p dir=\"auto\"><em>If you want to run the script automatically you need<\/em> <strong>Crontab installed<\/strong> where you execute the code <strong>or a free account to <a href=\"https:\/\/crontaboo.com\/\" rel=\"nofollow\">crontaboo.com<\/a><\/strong>.<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Open the script<\/h2>\n<p dir=\"auto\">Open <code>node\/sniffagrammer.js<\/code> or <code>php\/sniffagrammer.php<\/code>.<\/p>\n<p dir=\"auto\">Edit the code according to your needs:<\/p>\n<div dir=\"auto\" data-snippet-clipboard-copy-content=\"\/\/ type can be 'tag' or 'user'\nconst type = 'user'\n\n\/\/ if type is 'tag', the script will search for #orsifrancesco\n\/\/ if type is 'user', the script will search for @orsifrancesco\nconst value = 'orsifrancesco'\n\n\/\/ only for sniffagrammer.js\n\/\/ you can change the port of the server\nconst port = 8080\"><\/p>\n<pre><span>\/\/ type can be 'tag' or 'user'<\/span>\n<span>const<\/span> <span>type<\/span> <span>=<\/span> <span>'user'<\/span>\n\n<span>\/\/ if type is 'tag', the script will search for #orsifrancesco<\/span>\n<span>\/\/ if type is 'user', the script will search for @orsifrancesco<\/span>\n<span>const<\/span> <span>value<\/span> <span>=<\/span> <span>'orsifrancesco'<\/span>\n\n<span>\/\/ only for sniffagrammer.js<\/span>\n<span>\/\/ you can change the port of the server<\/span>\n<span>const<\/span> <span>port<\/span> <span>=<\/span> <span>8080<\/span><\/pre>\n<\/div>\n<h2 tabindex=\"-1\" dir=\"auto\">Upload the script on your web space.<\/h2>\n<p dir=\"auto\">If you use Node.js just run <code>node sniffagrammer.js<\/code> (and open the browser).<\/p>\n<p dir=\"auto\">If you use PHP you can just upload <code>sniffagrammer.php<\/code> to your web space.<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Open the browser<\/h2>\n<p dir=\"auto\">You should be able to see the output on <code>http:\/\/yourWebSpace:8080<\/code> (or the port you set, or <code>http:\/\/localhost:8080<\/code> if you are running the Node.js script on your computer) or <code>http:\/\/yourWebSpace\/sniffagrammer.php<\/code> (or <code>http:\/\/localhost<\/code> if you are running the PHP script on the <code>htdocs\/<\/code> folder of your computer).<\/p>\n<p dir=\"auto\">Every time you open the URL, the script will call <a href=\"https:\/\/orsi.me\/sniffagram\/\" rel=\"nofollow\">Sniffagram<\/a> endpoint checking for new images and saving them on <code>images\/<\/code> folder.<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/camo.githubusercontent.com\/94f40ffe1a4f072116ae4a1b21261477663941e75805a6abd9cbf392fe14c3ea\/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f77786d307765357270617a373562717466677a682e706e67\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/94f40ffe1a4f072116ae4a1b21261477663941e75805a6abd9cbf392fe14c3ea\/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f77786d307765357270617a373562717466677a682e706e67\" alt=\"JSON output\" data-canonical-src=\"https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/wxm0we5rpaz75bqtfgzh.png\"><\/a><\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Check the result<\/h2>\n<p dir=\"auto\">On <code>images\/{type}\/<\/code> (where <em>type<\/em> can be <code>tag<\/code> or <code>user<\/code>) you will see all the downloaded images.<\/p>\n<p dir=\"auto\">Every time you download a new image, you will find the hash (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Hash_function\" rel=\"nofollow\">wikipedia<\/a>) of the image path on <code>temp\/{type}\/<\/code>.<\/p>\n<p dir=\"auto\">These files are 0 bytes, they are necessary to prevent downloading the same images (<em>if you delete these files the images will be downloaded again<\/em>).<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/camo.githubusercontent.com\/2ec8e819c6a3f79b65c0c07716c4da260606577e9f0d290dd69a716230a87084\/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f737779757764796c6a363677746b7a387a6e37322e706e67\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/2ec8e819c6a3f79b65c0c07716c4da260606577e9f0d290dd69a716230a87084\/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f737779757764796c6a363677746b7a387a6e37322e706e67\" alt=\"folders\" data-canonical-src=\"https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/swyuwdylj66wtkz8zn72.png\"><\/a><\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Download images automatically every hour<\/h2>\n<p dir=\"auto\">To call the URL automatically, you need to run a crontab (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Cron\" rel=\"nofollow\">wikipedia<\/a>) script. If you don&#8217;t have crontab installed on your machine you can register at <a href=\"https:\/\/crontaboo.com\/\" rel=\"nofollow\">crontaboo.com<\/a> (<em>the free account gives you the possibility to call URLs every hour<\/em>).<\/p>\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https:\/\/camo.githubusercontent.com\/92e5fe753fc84438639846f1c1ce8505fb40907e3459ae9bcdcd1847c14c0417\/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f34797a356a6e776b3030336670636568696632672e706e67\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/92e5fe753fc84438639846f1c1ce8505fb40907e3459ae9bcdcd1847c14c0417\/68747470733a2f2f6465762d746f2d75706c6f6164732e73332e616d617a6f6e6177732e636f6d2f75706c6f6164732f61727469636c65732f34797a356a6e776b3030336670636568696632672e706e67\" alt=\"crontaboo.com\" data-canonical-src=\"https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/4yz5jnwk003fpcehif2g.png\"><\/a><\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Advanced way to do it<\/h2>\n<p dir=\"auto\"><a href=\"https:\/\/orsi.me\/sniffagram\/\" rel=\"nofollow\">Sniffagram<\/a> is an independent project that gives you 30 calls a day (<em>enough for a call every hour<\/em>). It caches the output for 5 minutes.<\/p>\n<p dir=\"auto\"><em>Due to the high number of requests, sometimes the token used for the project expires prematurely making the service unavailable (usually the expired token is replaced after a few minutes).<\/em><\/p>\n<p dir=\"auto\">For unlimited requests (no cache, every minute) you need to follow the tutorial from the official repo <a href=\"https:\/\/orsi.me\/instagram-without-api\/\" rel=\"nofollow\">Instagram without API<\/a> for <a href=\"https:\/\/github.com\/orsifrancesco\/instagram-without-api-node\">Node.js<\/a> or <a href=\"https:\/\/github.com\/orsifrancesco\/instagram-without-api\">PHP<\/a>.<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\">Resource Links<\/h2>\n<ul dir=\"auto\">\n<li><a href=\"https:\/\/orsi.me\/sniffagram\/\" rel=\"nofollow\">Sniffagram<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/orsifrancesco\/sniffagrammers\">GitHub Sniffagrammers<\/a> scripts for Node.js and PHP<\/li>\n<li><a href=\"https:\/\/crontaboo.com\/\" rel=\"nofollow\">Crontaboo<\/a>, simple way to call URLs without crontab<\/li>\n<li><a href=\"https:\/\/github.com\/orsifrancesco\/instagram-without-api-node\">Instagram without API<\/a> Node.js<\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/instagram-without-api-node\" rel=\"nofollow\">Instagram without API<\/a> npm<\/li>\n<li><a href=\"https:\/\/github.com\/orsifrancesco\/instagram-without-api\">Instagram without API<\/a> PHP<\/li>\n<li><a href=\"https:\/\/orsi.me\/instagram-without-api\/\" rel=\"nofollow\">Instagram without API<\/a> tutorial<\/li>\n<\/ul>\n<h2 tabindex=\"-1\" dir=\"auto\"><g-emoji alias=\"balance_scale\" fallback-src=\"https:\/\/github.githubassets.com\/images\/icons\/emoji\/unicode\/2696.png\">\u2696\ufe0f<\/g-emoji> License<\/h2>\n<p dir=\"auto\">Licensed under MIT<\/p>\n<h2 tabindex=\"-1\" dir=\"auto\"><g-emoji alias=\"coffee\" fallback-src=\"https:\/\/github.githubassets.com\/images\/icons\/emoji\/unicode\/2615.png\">\u2615<\/g-emoji> About<\/h2>\n<p dir=\"auto\">Any feedback to <a href=\"https:\/\/twitter.com\/orsifrancesco\" rel=\"nofollow\">@orsifrancesco<\/a> and <a href=\"https:\/\/www.paypal.com\/donate\/?business=5EL4L2LDYVH96\" rel=\"nofollow\">coffees<\/a> are welcome \ud83d\ude42<\/p>\n<\/p><\/div>\n<p><a href=\"https:\/\/github.com\/orsifrancesco\/sniffagrammers\" class=\"button purchase\" rel=\"nofollow noopener\" target=\"_blank\">Read More<\/a><br \/>\n Christeen Lanz<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sniffagrammers In this repo you can find Node.js and PHP files to automatically downloading pictures from instagram by https:\/\/orsi.me\/sniffagram Prerequisites Just a web space where to execute a Node.js script.. or PHP script; alternatively you can run the script on your computer. If you want to run the script automatically you need Crontab installed where<\/p>\n","protected":false},"author":1,"featured_media":633243,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[434,3159,46],"tags":[],"class_list":{"0":"post-633242","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-instagram","8":"category-saving","9":"category-technology"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts\/633242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/comments?post=633242"}],"version-history":[{"count":0,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts\/633242\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/media\/633243"}],"wp:attachment":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/media?parent=633242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/categories?post=633242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/tags?post=633242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}