EssamWisam / cmp-docs

A comprehensive guide for prospective, current and past students in the computer engineering department of Cairo university.
https://cmp-docs.pages.dev
54 stars 8 forks source link

Consider rewriting the LinkedIn script with `linkedin-api` #78

Open EssamWisam opened 2 hours ago

EssamWisam commented 2 hours ago

Problem Statement:

Run script is quite tedious. I tried to do it once and was unhappy with how long it was taking or the warnings being printed. @Iten-No-404 thankfully has invested periodic effort to run the script.

Proposed Solution:

Looking over their docs they have:

image

and

image

and

image

I have used this package before in a very different application (e.g., getting comments on a specific post) and with a little hack alhamdulilah was able to make it run via a Github action. I think the package is quite straightforward to use.

If @KnockerPulsar or @Iten-No-404 or someone else has time (i), test these functions to ascertain that this is inshAllah feasible and (ii), write a script using them to replace the current one (the new script inshAllah should be just few lines of code) then I can inshAllah try to do (iii), wrap it in a Github action to make it run periodically.

Iten-No-404 commented 1 hour ago

Interesting, @EssamWisam. I took a quick look at their documentation and it seems that they use HTTP requests directly instead of using Selenium which should save running time.

However, I think we may still face the same issue of verification when using GitHub actions since the IP address of the machine that's going to run the script will definitely be a new IP address that hasn't been associated with the account before. Have you tried using this package with GitHub actions before? 🤔

Either way, I can take a look at the package and try it out. Decreasing the execution time would still be quite beneficial.

EssamWisam commented 1 hour ago

Have you tried using this package with GitHub actions before? 🤔

Yes, I thought I mentioned in the original post that I did but it required a little hack. Basically, I ported my local browser cookies into Github and it worked. There is one caveat: if I ever log out from browser then cookies expire but that's easy to handle by simply downloading a new browser lol...

Iten-No-404 commented 1 hour ago

Sorry, seems like I missed that line. 😂 I get what you mean. Downloading any lightweight browser should be quite simple and sufficient. I'll try out the package today or tomorrow insha'allah, and inform you of my findings.

EssamWisam commented 1 hour ago

I sincerely thank you in advance for your proactivity.