Skip to content

Commit

Permalink
Merge pull request #15 from UPB-SS1/utilidades
Browse files Browse the repository at this point in the history
Utilidades
  • Loading branch information
csotomon authored May 8, 2021
2 parents 4c7a05b + 3d7278a commit 45a17fc
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 120 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def main():
# Init CrowdTangle with api key
crowd_tangle = CrowdTangle("abc123def345")
ct_df = crowd_tangle.get_shares(urls=links_df, url_column='clean_url', date_column='date',clean_urls=True, platforms='facebook', sleep_time=30)
shared = Shared()
crowtangle_shares_df, shares_graph, q = shared.coord_shares(ct_df, clean_urls=True)
shared = Shared(ct_df)
crowtangle_shares_df, shares_graph, q = shared.coord_shares(clean_urls=True)

#Build Gephi File
for node in shares_graph.nodes(data=True):
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../../src'))


# -- Project information -----------------------------------------------------

project = 'PyCooRnet'
copyright = '2020, PyCooRnet Developers'
copyright = '2021, PyCooRnet Developers'
author = 'PyCooRnet Developers'


Expand Down Expand Up @@ -53,4 +53,4 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_static_path = ['_static']
8 changes: 3 additions & 5 deletions src/pycoornet/crowdtangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
class CrowdTangle:
"""Descripción de la clase.
:param api_key: CrowdTangle API key.
:type api_key: string
api_key (str): CrowdTangle API key.
"""

def __init__(self, api_key):
Expand All @@ -29,7 +28,7 @@ def get_shares(self, urls, url_column='url', date_column='date', platforms=('fac
""" Get the URLs shares from CrowdTangle from a list of URLs with publish datetime
Args:
urls (dataframe): a dataframe with at least a column "url" containing the URLs, and a column "date" with their published date
urls (pandas.DataFrame): a dataframe with at least a column "url" containing the URLs, and a column "date" with their published date
url_column (str, optional): name of the column (placed inside quote marks) where the URLs are stored. Defaults to 'url'.
date_column (str, optional): name of the column (placed inside quote marks) where the date of the URLs are stored. Defaults to 'date'.
platforms (tuple, optional): a tuple of platforms to search. You can specify only facebook to search on Facebook, or only instagram to
Expand All @@ -48,8 +47,7 @@ def get_shares(self, urls, url_column='url', date_column='date', platforms=('fac
SystemExit: [description]
Returns:
[pandas.Dataframe]: [A pandas dataframe of posts that shared the URLs and a number of variables returned by the https://github.com/CrowdTangle/API/wiki/Links
CrowdTangle API links endpoint and the original data set of news.
pandas.DataFrame: A pandas dataframe of posts that shared the URLs and a number of variables returned by the https://github.com/CrowdTangle/API/wiki/Links CrowdTangle API links endpoint and the original data set of news.
"""

try:
Expand Down
Loading

0 comments on commit 45a17fc

Please sign in to comment.