<commit_before># -*- coding: utf-8 -*-
PREFIX = "/video/ihop"
NAME = "IHOP Plugin"

MAXRESULTS = 50

IHOP_FEED_URL = "http://feed.theplatform.com/f/IfSiAC/5ct7EYhhJs9Z/"
IHOP_FEED_QUERY = "?q=%s&range=0-%s&=&sort=pubDate|desc&count=true"
IHOP_FEED_FILT = "&byCustomValue={ihopkc$setType}{Intercession}"
IHOP_JAVASCRIPT = "http://cdn.ihopkc.org.edgesuite.net/wp-content/themes/ihopkc_theme/_js/ihopkc-main.min.js"

RE_WLEADER = Regex("""e.worshipLeaders\[0\]\.toLowerCase\(\)\)return"";var t\=(\[[a-zA-Z0-9\a\A\s",]+\]);""")

USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0'
TITLE = L('IHOP')
ICON = 'icon-default.png'

####################################################################################################
def Start():
    HTTP.CacheTime = CACHE_1HOUR
    HTTP.Headers['User-Agent'] = USER_AGENT
    Log.Debug("Starting the IHOP Plugin")

@handler(PREFIX, NAME)
def MainMenu():
    Log.Debug("Load Main Menu")
    wleaders = []
    try:
        Log.Debug("Loading Worship Leaders")
        wleaders = JSON.ObjectFromString(RE_WLEADER.search(IHOP_JAVASCRIPT).group(0))
        Log.Debug(str(wleaders))
    except:
        pass

@route(PREFIX + '/worshiper')
def WorshipLeaderMenu(channel):
    pass<commit_msg>Tweaking the code so to load the worship leaders from the javascript<commit_after># -*- coding: utf-8 -*-
PREFIX = "/video/ihop"
NAME = "IHOP Plugin"

MAXRESULTS = 50

IHOP_FEED_URL = "http://feed.theplatform.com/f/IfSiAC/5ct7EYhhJs9Z/"
IHOP_FEED_QUERY = "?q=%s&range=0-%s&=&sort=pubDate|desc&count=true"
IHOP_FEED_FILT = "&byCustomValue={ihopkc$setType}{Intercession}"
IHOP_JAVASCRIPT_URL = "http://cdn.ihopkc.org.edgesuite.net/wp-content/themes/ihopkc_theme/_js/ihopkc-main.min.js"

RE_WLEADER = Regex("""e.worshipLeaders\[0\]\.toLowerCase\(\)\)return"";var t\=(\[[a-zA-Z0-9\a\A\s",]+\]);""")

USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0'
TITLE = L('IHOP')
ICON = 'icon-default.png'

####################################################################################################
def Start():
    HTTP.CacheTime = CACHE_1HOUR
    HTTP.Headers['User-Agent'] = USER_AGENT
    Log.Debug("Starting the IHOP Plugin")

@handler(PREFIX, NAME)
def MainMenu():
    Log.Debug("Load Main Menu")
    wleaders = []
    try:
        Log.Debug("Loading Worship Leaders")
        IHOP_JAVASCRIPT_RAW = HTTP.Request(IHOP_JAVASCRIPT_URL).content
        wleaders = JSON.ObjectFromString(RE_WLEADER.search(IHOP_JAVASCRIPT_RAW).group(0))
        Log.Debug(str(wleaders))
    except:
        pass

@route(PREFIX + '/worshiper')
def WorshipLeaderMenu(channel):
    pass
{'fraction_non_alphanumeric': 0.23571161748225625, 'fraction_numerical': 0.023160254015689205, 'mean_word_length': 4.614255765199162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3275047', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1014, 'n_words': 148}