Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env python
from extensions.bas_extension import BaseExtension
from utils import Utils
class Share(BaseExtension):
def __init__(self):
BaseExtension.__init__(self)
self.utils = Utils()
def excute(self, form_dict):
url = form_dict['url'].encode('utf-8')
title = form_dict['rTitle']
if url == '':
url = self.utils.toQueryUrl(url, title)
html = '<div class="ref"><br>'
html += '<a title=""><img src="http://mycroftproject.com/updateos.php/id0/facebookvideomirror.ico"></a> '
html += '<a title=""><img src="http://mycroftproject.com/updateos.php/id0/twitter-music.png"></a> '
html += '<a title=""><img src="http://mycroftproject.com/updateos.php/id0/plusgoogle.ico"></a> '
html += '<a title=""><img src="http://mycroftproject.com/updateos.php/id0/linkedin_googfr.ico"></a> '
html += '<a href="mailto:?subject=' + title + ' (' + url + ')&body=' + title+ ' (' + url + ')"><img src="http://mycroftproject.com/updateos.php/id0/gmail.ico"></a> '</div>
#!/usr/bin/env python
from extensions.bas_extension import BaseExtension
from utils import Utils
class Fulltext(BaseExtension):
def __init__(self):
BaseExtension.__init__(self)
self.utils = Utils()
def excute(self, form_dict):
rID = form_dict['rID'].encode('utf8')
if rID.find('arxiv') != -1:
arxiv_id = rID[rID.find('arxiv-') + 6 :].replace('-', '.')
version = self.utils.get_last_arxiv_version(arxiv_id)
return 'http://arxiv.org/pdf/' + arxiv_id + version
return 'http://scholar.google.com.secure.sci-hub.io/scholar?q=' + form_dict['rTitle']
def check(self, form_dict):
fileName = form_dict['fileName'].encode('utf8')
return fileName.find('arxiv') != -1
def __init__(self):
BaseExtension.__init__(self)
# -*- coding: utf-8 -*-
import sys, os
from extensions.bas_extension import BaseExtension
from utils import Utils
from update.all_subject import default_subject
from record import ReferenceRecord
from record import CategoryRecord, Category
from semanticscholar import Semanticscholar
from config import Config
from bs4 import BeautifulSoup
import requests
from extensions.reference.youtube_helper import YoutubeHelper
from record import Record
class Reference(BaseExtension):
record_reference = {}
html = ''
form_dict = None
def __init__(self):
BaseExtension.__init__(self)
self.utils = Utils()
self.semanticscholar = Semanticscholar()
self.category_obj = Category()
self.helper = YoutubeHelper()
def loadReference(self, filename, rID):
print 'loadReference ' + filename + ' rID:' + rID
if len(self.record_reference) != 0 and self.record_reference.has_key(rID):
return
def __init__(self):
BaseExtension.__init__(self)
self.semanticscholar = Semanticscholar()
self.category_obj = Category()
self.utils = Utils()
#!/usr/bin/env python
from extensions.bas_extension import BaseExtension
from utils import Utils
class Comment(BaseExtension):
def excute(self, form_dict):
rID = form_dict['rID'].encode('utf8')
html = ''
if rID.find('arxiv') != -1:
arxiv_id = rID[rID.find('arxiv-') + 6 :].replace('-', '.')
utils = Utils()
for e in utils.get_arxiv_entries(arxiv_id):
j = utils.encode_feedparser_dict(e)
if j.has_key('arxiv_comment'):
print j['arxiv_comment']
html += '<br>' + j['arxiv_comment'] + '<br>'
html += j['updated'][0 : j['published'].find('T')] + ' '
html += j['id'][j['id'].rfind('v') :] + '<br>'
def __init__(self):
BaseExtension.__init__(self)
self.utils = Utils()
self.tag = Tag()
self.form_dict = None
#!/usr/bin/env python
import sys, os
from extensions.bas_extension import BaseExtension
from utils import Utils
import feedparser
class Rss(BaseExtension):
def __init__(self):
BaseExtension.__init__(self)
self.utils = Utils()
def excute(self, form_dict):
fileName = form_dict['fileName'].encode('utf8')
rID = form_dict['rID'].encode('utf8')
url = form_dict['url']
return self.genHtml(url, form_dict['divID'].encode('utf8'), rID)