Giter Site home page Giter Site logo

lorey / socials-api Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 5.0 115 KB

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ (Rest) API to extract social media profiles from websites or specific URLs

Home Page: http://socials.karllorey.com

Dockerfile 1.79% Makefile 1.92% Python 55.47% HTML 40.82%
socials social-media-profiles api python django django-rest-framework scraping rest-api

socials-api's Introduction

socials API: extract social media profiles

The socials API allows you to extract social media profiles from urls. It is an API version of my library called socials for Python.

Try it at socials.karllorey.com.

Example

Requesting http://socials.karllorey.com/api/fetch-url with a POST request and url=https://karllorey.com as parameter will return all social media profiles linked from karllorey.com (my personal website). For example, with cURL:

curl --data "url=https://karllorey.com" http:/socials.karllorey.com/api/fetch-url

Response:

{
    "matches_per_platform": {
        "facebook": [],
        "twitter": [
            "https://twitter.com/karllorey"
        ],
        "linkedin": [],
        "github": [
            "https://github.com/lorey/karllorey.com",
            "https://github.com/lorey"
        ],
        "email": []
    }
}

Test it (on the website)

There's a page, socials.karllorey.com/try, where you can preview the functionality.

Test it (with the browsable API)

Django REST Framework offers a browsable API where you can test all functionality in the browser.

  1. Go to socials.karllorey.com/api/fetch-url
  2. Select for Media type: application/x-www-form-urlencoded
  3. Enter in Content: url=https://karllorey.com or any other url

Screenshot of socials API's browsable API

Set it up for yourself

socials API is dockerized and can be set up via docker-compose within seconds:

docker-compose build
docker-compose up -f docker-compose.yml -f docker-compose.prod.yml -d

It should now be accessible at port 80. The development version you get with docker-compose up is at port 8016. Make sure to adapt the rate limit in socials_api/settings.py.

I have personal ansible and terraform files for deployment via docker-compose on AWS. Reach out if you're interested.

References

socials-api's People

Contributors

dependabot[bot] avatar lorey avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

socials-api's Issues

Fix wrong URLs in browsable API

When developing under a port other than 80, URLs should be localhost:123/api but are localhost/api. Might have to do with nginx proxy, using USE_X_FORWARDED_HOST did not help so far.

Full regex

It's possible to implement the "Monster regex" from the other repo into this one?

Thanks.

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.