Skip to main content

Extract Social Media

https://img.shields.io/pypi/v/extract-social-media.svg https://img.shields.io/pypi/pyversions/extract-social-media.svg https://img.shields.io/travis/fluquid/extract-social-media.svg Coverage Status Requirements Status

Extract social media links from websites.

Many websites reference their facebook, twitter, linkedin, youtube accounts and these can be invaluable to gather 360 degree information about a company.

This library allows to extract links or handles for the most commonly used international social media networks.

  • Free software: MIT license

  • Python versions: 2.7, 3.4+

Features

  • Extract social media links/handles from html content

  • Attempts to extract links/handles also from widgets, scripts, etc.

  • Supports most widely used social networks

    • facebook

    • linkedin

    • twitter

    • youtube

    • github

    • google plus

    • pinterest

    • instagram

    • snapchat

    • flipboard

    • flickr

    • weibo

    • periscope

    • telegram

    • soundcloud

    • feedburner

    • vimeo

    • slideshare

    • vkontakte

    • xing

Quickstart

import requests
from html_to_etree import parse_html_bytes
res = requests.get('https://techcrunch.com/contact/')
tree = parse_html_bytes(res.content, res.headers.get('content-type'))

set(find_links_tree(tree))

{'http://pinterest.com/techcrunch/',
 'http://www.youtube.com/user/techcrunch',
 'http://www.linkedin.com/company/techcrunch',
 'https://www.facebook.com/techcrunch',
 'https://flipboard.com/@techcrunch',
 'http://instagram.com/techcrunch',
 'https://plus.google.com/+TechCrunch',
 'https://instagram.com/techcrunch',
 'https://twitter.com/techcrunch'}

Caveats

  • currently finds all social media links on a page

    • need to look into finding most relevant links based on link location, link context, company name, etc.

Credits

This package was created with Cookiecutter and the fluquid/cookiecutter-pypackage project template.

History

0.4.0 (2017-08-18)

  • naive blacklisting for photos, videos, search, tweets, etc.

0.3.0 (2017-08-18)

  • fixed exception when “href” is empty or non-string

0.2.0 (2017-06-08)

  • better test coverage

  • accepting data-href

0.1.0 (unreleased)

  • First release on PyPI.

Metadata

Release files for extract-social-media 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extract-social-media 0.4.0
File Size Uploaded Provenance Actions
extract-social-media-0.4.0.tar.gz 18.3 kB Without provenance Details for extract-social-media-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for extract-social-media 0.4.0
File Interpreter ABI Platform Actions
extract_social_media-0.4.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for extract_social_media-0.4.0-py2.py3-none-any.whl

Total release size: 24.5 kB

Release files / extract-social-media-0.4.0.tar.gz

Download URL extract-social-media-0.4.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c062972a8b981a5be080c25a4d2e650ef7e875b8898ac7074424f3e653baf574
BLAKE2b-256 checksum
How to use checksums
b931117982deaf788e74710741e32467cd94e52d3e51bf6724ed7e41a53ea8cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / extract_social_media-0.4.0-py2.py3-none-any.whl

Download URL extract_social_media-0.4.0-py2.py3-none-any.whl
Size 6.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
de3cb65b312f0ea7f0e60edbdbe6e567a3c957fb91ceca77e73a0f8622fb8673
BLAKE2b-256 checksum
How to use checksums
6698d21c9cecb686d4be026bee1a890e3b0cd0b7837e99486c2a68a085308d53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for extract-social-media 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page