agora-inc / platform

Full code for mora.stream, the "Twitch.tv for academic researchers". The streaming platform served several thousands of concurrent viewers. This has now been acquired and absorbed by Cassyni.
https://cassyni.com/mora
4 stars 0 forks source link

Next steps with the profiles #500

Open AlainRossier opened 2 years ago

AlainRossier commented 2 years ago

Urgent

Key features

Would be nice

argoopjmc commented 2 years ago

Trivial things, but

a) When someone stores their Google Scholar links, add the hl=en parameter at the end ( to make sure that the english language version is stored) or just remove the hl parameter at the end completely ( furl makes it simple)

b) Use the following code to get the image from a google scholar profile

import requests
from furl import furl

def getImageFromGoogleScholar(username: str, gslink: str):

    f = furl(gslink)
    f.set(
        host = 'scholar.googleusercontent.com', 
         path = 'citations'
    ).add(
        {"view_op": 'medium_photo'}
    ).url

    response = requests.get(f.url)

    file = open(f"{username}_profile.png", "wb")
    file.write(response.content)
    file.close()

getImageFromGoogleScholar("Remy", "https://scholar.google.com/citations?user=kgggI14AAAAJ")

c) There is the scholarly package for interfacing with google scholar ( I looked at it and it seems very easy to use, returning all the information like publication,domain,profile_picture in the form of a dict), however they recommend using proxies for large number of requests.

AlainRossier commented 2 years ago

Thanks, will do.

On Tue, 28 Dec 2021, 22:18 argoopjmc, @.***> wrote:

Trivial things, but

a) When someone stores their Google Scholar links, add the hl=en parameter at the end ( to make sure that the english language version is stored) or just remove the hl parameter at the end completely ( furl makes it simple)

b) Use the following code to get the image from a google scholar profile

import requests from furl import furl

def getImageFromGoogleScholar(username: str, gslink: str):

f = furl(gslink)
f.set(
    host = 'scholar.googleusercontent.com',
     path = 'citations'
).add(
    {"view_op": 'medium_photo'}
).url

response = requests.get(f.url)

file = open(f"{username}_profile.png", "wb")
file.write(response.content)
file.close()

getImageFromGoogleScholar("Remy", "https://scholar.google.com/citations?user=kgggI14AAAAJ")

— Reply to this email directly, view it on GitHub https://github.com/agora-inc/agora/issues/500#issuecomment-1002285504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEE4XDCXXIPAJFPHFLZRVHLUTISR5ANCNFSM5K2SURYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

argoopjmc commented 2 years ago

Also just realised this is the 500th issue 🎉🎉🎉