-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shikha Bhatia
committed
Dec 10, 2020
0 parents
commit 577c17b
Showing
10 changed files
with
287 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF | ||
formats: | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
python: | ||
version: 3.7 | ||
install: | ||
- requirements: requirements.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
import os | ||
import sys | ||
sys.path.insert(0, os.path.abspath('E:/studio/API DOCS/Test/')) | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = 'youtube-api-datakund' | ||
copyright = '2020, datakund' | ||
author = 'datakund' | ||
|
||
# The full version, including alpha/beta/rc tags | ||
release = '0.0.2' | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = [] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = 'sphinx_rtd_theme' | ||
|
||
# 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'] | ||
pygments_style = 'sphinx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Functions | ||
************************************************** | ||
|
||
``datakund`` provides following functions for youtube:- | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.. test documentation master file, created by | ||
sphinx-quickstart on Mon Dec 7 15:41:34 2020. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Automate Youtube with Datakund | ||
==================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
intro | ||
installation | ||
functions | ||
otherfunctions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Installation/Usage: | ||
******************* | ||
You can find this package on Pypi (see `here <https://pypi.org/project/datakund/>`_). | ||
|
||
Command to install :- ``pip install datakund`` | ||
|
||
Import datakund | ||
************************************************** | ||
.. code-block:: python | ||
from datakund.datakund import * | ||
Creating Object | ||
************************************************** | ||
.. code-block:: python | ||
obj=datakund() | ||
youtube=obj.youtube() | ||
It will return the object which you can further use to call youtube functions and opens a automated browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Introduction | ||
*************************** | ||
|
||
``datakund`` is an automation library which can be used to automate tasks like sending mails,scraping data,auto checkout and many more. You can download the source code from here(see `here <https://github.com/testdatakund/youtube>`_) | ||
|
||
It uses selenium to automate the things. You can use its inbuilt functions like ``youtube_login``, ``youtube_auto_like`` etc. in a very easy way. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
Other Functions | ||
************************************************** | ||
You can use basic functions which selenium provides with this library like opening a url, get pagesource, get current url etc. These are the functions:- | ||
|
||
Open | ||
======== | ||
|
||
It will open the url provided in the argument. | ||
|
||
.. py:function:: youtube.open(url) | ||
:param str url: Link which need to be opened | ||
:return: {} | ||
:rtype: dict | ||
|
||
|
||
Get Page Title | ||
================= | ||
|
||
It returns the title of page opened. | ||
|
||
.. py:function:: youtube.get_page_title() | ||
:return: {"pagetitle":"youtube"} | ||
:rtype: dict | ||
|
||
Get Page Source | ||
=================== | ||
|
||
It returns the pagesource of page opened. | ||
|
||
.. py:function:: youtube.get_page_source() | ||
:return: {"pagesource":"pagesource"} | ||
:rtype: dict | ||
|
||
Get Current Url | ||
=================== | ||
|
||
It returns the pagesource of page opened. | ||
|
||
.. py:function:: youtube.get_current_url() | ||
:return: {"url":"url"} | ||
:rtype: dict | ||
|
||
Reload | ||
=================== | ||
|
||
It reloads the page opened. | ||
|
||
.. py:function:: youtube.reload() | ||
:return: {} | ||
:rtype: dict | ||
|
||
Keypress | ||
=================== | ||
|
||
It perform the keypress passed. | ||
|
||
.. py:function:: youtube.keypress(key) | ||
:param str key: Key which need to be pressed, e.g pagedown,arrowleft,enter | ||
:return: {} | ||
:rtype: dict | ||
|
||
Scroll | ||
=================== | ||
|
||
It scrolls to the end of page. | ||
|
||
.. py:function:: youtube.scroll() | ||
:return: {} | ||
:rtype: dict | ||
|
||
End | ||
=================== | ||
|
||
It ends the youtube session and close the automated chromedriver. | ||
|
||
.. note:: You will need to create youtube object again after ``end()``. | ||
|
||
.. py:function:: youtube.end() | ||
:return: {} | ||
:rtype: dict | ||
|
||
Quit | ||
=================== | ||
|
||
It quits the datakund application runing in background. | ||
|
||
.. note:: You will need to import datakund library again to start datakund application. | ||
|
||
.. py:function:: youtube.quit() | ||
:return: {} | ||
:rtype: dict |