Giter VIP home page Giter VIP logo

insta_reddit_bot's Introduction

Hi there ๐Ÿ‘‹

My name is Freek. I'm a guy who enjoys programming (who would have thought!), playing videogames, producing and listening to music, and taking pictures. Currently working as System & Network Administrator for Codam Coding College, which is part of the 42 Network. I also studied there - if you're interested in what the school's curriculum is like, feel free to refer to my submitted work in the @fbescodam organization.

I've created several personal projects ever since I started programming in 2015, some larger than others. The biggest one is probably TunePlay, which was a website where you could play music from most platforms (YouTube, Spotify, Soundcloud, Deezer, Mixcloud) using just one interface. I also created @me_irl_bot on Instagram, which gained over 200,000 followers and roughly 25 million weekly impressions (until Instagram deactivated the account). In 2021, I created Improved Intra 42, a browser extension that aims to improve the intranet of 42 Network schools by providing more (personalized) features and improving its visuals. It is currently used by over 25% of the active student population.

The source code for most of my projects is open sourced here, on this GitHub profile. Have a look around!

Links

Portfolio (needs some updating) | LinkedIn | Twitter | Instagram | 42 Profile

Some useless stats

Programming languages I main

I am proficient in Javascript/Typescript, Python, PHP, C, Bash, CSS (yes, CSS is not a "real" language, but it is still a valuable skill). I have also worked with C++, Java, Go, Ruby, pSQL and probably a bunch of others before. In the end, I believe I can pick up any language and understand its functioning.

Programming history: my journey through the years

Click to view
  • 2023: Migrated the entire fleet of computers at Codam Coding College from macOS to Linux with almost zero downtime.
  • 2022: Joined the staff team of Codam Coding College as System and Network Administrator, finished their core curriculum.
  • 2021: Started attending Codam Coding College (at the end of 2020) to further increase my programming skills and meet like-minded people. Created Improved Intra 42, a browser extension with over 3000 monthly users.
  • 2020: Covid-19 disrupted the high school I was working at as IT Assistant. However, I made sure lessons could continue smoothly within 3 days of the school's closure, by creating a link between our scheduling software and Google Meet.
  • 2019: Co-founded a start-up in Switzerland where I was CTO, which gained the interest of a VC; created a functioning MVP.
  • 2018: Discovered the use of APIs, bundled many together into TunePlay (a website that played music from various streaming services using the same interface). Started @me_irl_bot on Instagram, which gained over 200.000 followers and 25 million weekly impressions.
  • 2017: Started developing back-ends in PHP for the previously created front-ends
  • 2016: Substantially increased my CSS and Javascript skills.
  • 2015: Started basic web development: learnt the ins and outs of HTML & CSS.
  • 2014: Started attending a computer science course in high school: learnt binary calculation, Java programming, basic HTML, simplistic "AI" scenarios.
  • <2013: Broke and fixed many Windows installations and versions, which taught me a lot about this operating system.

insta_reddit_bot's People

Contributors

dependabot[bot] avatar freekbes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

insta_reddit_bot's Issues

Automate on windows!

Hi I saw that cleartemp wasn't working in windows so I made it work for windows.

function clearTemp() {
    exec(**`${__dirname}/clear.bat`**, function(err, stdout, stderr) {
        if (err) {
            console.warn("Failed to clear temp folder!");
        }
        else {
            console.log("Cleared temp folder");
        }
    });
}

I made a batch file so every time cleartemp is called the batch file will run to clear the temp folder.

del "%cd%\temp\*" /s /f /q

batch file will be on the same folder that main.js is.

am getting this issue can u help he sorting it out

Post added to done-list
Downloading media...Initial mediaUrl: https://v.redd.it/odjwdtp6d8k71
GIFV on Imgur detected
(node:12780) UnhandledPromiseRejectionWarning: https://ffmpeg.org/download.html to enable support for video posts.
(Use node --trace-warnings ... to show where the warning was created)
(node:12780) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:12780) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Crontab Questions

Hi!
Thank's for your previous reply, however I now bought a Raspberry Pi and have a few questions about the Crontab:

  • Do I still need to do node main.js once for the crontab to start working?
  • Does crontab start working after you finish editing?
  • Do I need to leave the command prompt / terminal open for crontab to work?
  • Do you need to manually start anything or will the crontab do everything without needing 'a switch to be flipped'?

TypeError: Cannot read property 'toString' of null when no post to do

null
(node:11884) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of null
at D:\Softwares\mine\programming\Insta Bot\redi to insta poster\insta redi poster\bot.js:79:76
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use node --trace-warnings ... to show where the warning was created)
(node:11884) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11884) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Bot crashes when its trying to upload video

happens everytime its trying to upload video
[AVIOContext @ 0000022a313390c0] Statistics: 131072 bytes read, 0 seeks
Conversion failed!

at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

Getting Response Error 302 - Won't login to instagram

Hello, I am getting this error:

~/AzureFavorableStructures$ node bot.js
Initializing...
Temporary folder does not exist! Creating...
Temporary folder created.
posts.json missing! Creating...
posts.json cleared
PostsStatus initialized
Current time: 20:58
Signing in to Instagram...
Could not sign in to Instagram
IgResponseError: POST /api/v1/accounts/msisdn_header_bootstrap/ - 302 Found; 
    at Request.handleResponseError (/home/runner/AzureFavorableStructures/node_modules/instagram-private-api/dist/core/request.js:125:16)
    at Request.send (/home/runner/AzureFavorableStructures/node_modules/instagram-private-api/dist/core/request.js:53:28)
    at async AccountRepository.msisdnHeaderBootstrap (/home/runner/AzureFavorableStructures/node_modules/instagram-private-api/dist/repositories/account.repository.js:251:26)
Logged in to Discord as **************

Does anyone know how to fix this?

How to add hasttags

How do I make it so that it adds hashtags instead of saying from which subreddit / reddit user it mirrored the post from? This would be really great if it works. Your bot is the only one that I've found that's working, big ups to you!

Hmm running on Mac OS

jakenelson@Jakes-MacBook-Pro-2 insta_reddit_bot-master % node bot.js
Initializing...
internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module 'instagram-private-api'
Require stack:

  • /Users/jakenelson/Desktop/insta_reddit_bot-master/handlers/instagram.js
  • /Users/jakenelson/Desktop/insta_reddit_bot-master/bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object. (/Users/jakenelson/Desktop/insta_reddit_bot-master/handlers/instagram.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/jakenelson/Desktop/insta_reddit_bot-master/handlers/instagram.js',
    '/Users/jakenelson/Desktop/insta_reddit_bot-master/bot.js'
    ]
    }
    jakenelson@Jakes-MacBook-Pro-2 insta_reddit_bot-master %

am getting issue related ytdl dwnld plz help

Downloading media...
Initial mediaUrl: https://v.redd.it/xvsj09u6i9k71
GIFV on Imgur detected
YT-DL URL: https://www.reddit.com/r/videomemes/comments/pdrwpb/crabs_fucking_die_emotional/
youtube-dl -o D:\New folder (2)\tarunbot\temp\pdrwpb-temp.mp4 https://www.reddit.com/r/videomemes/comments/pdrwpb/crabs_fucking_die_emotional/
(node:15756) UnhandledPromiseRejectionWarning: Error: Command failed: youtube-dl -o D:\New folder (2)\tarunbot\temp\pdrwpb-temp.mp4 https://www.reddit.com/r/videomemes/comments/pdrwpb/crabs_fucking_die_emotional/
ERROR: fixed output name but more than one file to download

at ChildProcess.exithandler (child_process.js:390:12)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

(Use node --trace-warnings ... to show where the warning was created)
(node:15756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

imgur image links.

I see that when it finds an imgur image link it will try to retrieve the url image but in the end it gets stuck. Is it fixable?
image

Suggestion

It would be so so so incredibly useful if you could make a TikTok bot that automatically grabs a well-liked video from a configurable #hashtag on tiktok, then checks if its below 1:00 duration (otherwise its too long for instagram's normal post) and then uploads it as video to your instagram account.

https://github.com/techyhoney/TikTok_Scrapper
This is a bot that grabs all of the videos from a certain hashtag, it would need to filter the videos in the output folder in duration and then upload them to instagram (what your bot is doing).
Except now it uses these downloaded videos.
I am no coding expert at all, so I don't know if this is possible.

This would be the best bot ever.

Crontab not working

image

Below these lines I put the following code:

/*10 * * * node ~/Desktop/insta_reddit_bot-master/main.js >/dev/null 2>&1

But this didnt do anything. Also usign the frequencies listed in the example (9-18 18-9), instead of /*10, it didn't work.

Please help me :(

Not familiar with this error but if anyone knows maybe we can fix these bugs together and make this a bomb ass bot.

Subreddit set to /r/strangerthings
Found a post to handle:
http://www.reddit.com//r/StrangerThings/comments/vdjtvo/clock_my_parents_got_oddly_looks_just_like_the/
Post added to done-list
Unable to handle post!
Selftext posts are not supported yet.
(node:409247) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
at Object.exports.sendSystemMessage (/home/ubuntu/stb/handlers/discordbot.js:123:61)
at /home/ubuntu/stb/bot.js:77:18
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:409247) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:409247) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

After running the bot for a while, it cannot post the credits.

Could not comment credits!
IgActionSpamError: POST /api/v1/media/2616282449558430455_48796745130/comment/ - 400 Bad Request; feedback_required
at Request.handleResponseError (/home/legend/Desktop/bot1/node_modules/instagram-private-api/dist/core/request.js:99:20)
at Request.send (/home/legend/Desktop/bot1/node_modules/instagram-private-api/dist/core/request.js:53:28)

It works at first on a new account, then after a while I get that error.

403 -Forbidden; Logged-in use not supported

Suddenly today (22/05/2021) i am getting this error...was Instagram API updated today? It was working fine before today

Initializing...
PostsStatus initialized
Current time: 11:47
Parsing cookies...
Signing in to Instagram...
Could not sign in to Instagram
IgResponseError: POST /api/v1/accounts/get_prefill_candidates/ - 403 Forbidden; Logged-in use not supported
    at Request.handleResponseError (C:\Users\HP\Documents\GitHub\insta_reddit_bot\node_modules\instagram-private-api\dist\core\request.js:125:16)
    at Request.send (C:\Users\HP\Documents\GitHub\insta_reddit_bot\node_modules\instagram-private-api\dist\core\request.js:53:28)
    at async AccountRepository.getPrefillCandidates (C:\Users\HP\Documents\GitHub\insta_reddit_bot\node_modules\instagram-private-api\dist\repositories\account.repository.js:273:26)

The bot can't upload video's to IG

I use your bot for a few days now and it works fine, exept the video function.
For some reason, the videos I submit to reddit are detected, but not ported to IG.
I got the logs here.
I did not know where to contact you in the first place, so I also send you this issue on your IG DMs.

Error

Error: aborted
at connResetException (node:internal/errors:642:14)
at TLSSocket.socketCloseListener (node:_http_client:424:27)
at TLSSocket.emit (node:events:381:22)
at node:net:666:12
at TCP.done (node:_tls_wrap:577:7) {
code: 'ECONNRESET'
}

Everytime i run the bot.js this error pops up. And then the program get stuck after resizing the image.
OS: WIndows 10

How to automate on Windows?

The bot fails to clear the temp folder so i have to do it manually, was wondering if there's a fix for that

and how can i automate this on windows? i don't have a Linux machine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.