예제 #1
0
def category(request, slug):
    if slug == "vr_top_device_featured_category":
        url = "https://play.google.com/store/apps/stream/"+slug+"?hl=en"
    elif slug == "FAMILY_AGE_RANGE1":
        url = "https://play.google.com/store/apps/category/FAMILY?age=AGE_RANGE1&hl=en"
    elif slug == "FAMILY_AGE_RANGE2":
        url = "https://play.google.com/store/apps/category/FAMILY?age=AGE_RANGE2&hl=en"
    elif slug == "FAMILY_AGE_RANGE3":
        url = "https://play.google.com/store/apps/category/FAMILY?age=AGE_RANGE3&hl=en"
    else:
        url = "https://play.google.com/store/apps/category/"+slug+"?hl=en"

    name = SubCategory.objects.values_list('name', flat=True).filter(link=slug,id_subcategory=1)

    data = {
        "appName": settings.APP_NAME,
        "appTitle": name[0]+" - Android Apps on "+settings.APP_NAME,
        "name": "apps",
        "subname": "home",
        "subcategory": SubCategory.objects.all().filter(id_subcategory=1),
        "array": homeviews.scraping(url),
        "sidebar": "./sidebars/sidebar_apps.html",
        "current_url": request.build_absolute_uri
    }

    return render_to_response("apps.html", data)
예제 #2
0
def new(request, template="apps.html"):
    url = 'https://play.google.com/store/apps/new?hl=en'

    data = {
        "appName": settings.APP_NAME,
        "appTitle": "New Releases - Android Apps on "+settings.APP_NAME,
        "name": "apps",
        "subname": "new",
        "subcategory": SubCategory.objects.all().filter(id_subcategory=1),
        "array": homeviews.scraping(url),
        "sidebar": "./sidebars/sidebar_apps.html",
        "current_url": request.build_absolute_uri
    }

    return render_to_response(template, data)
예제 #3
0
def appsposts(request, version, id):
    post = posts.objects.all().filter(id=id,version=version)
    apps_details = details.objects.filter(id_posts_id=post[0].id)
    apps_ss = screenshot.objects.filter(id_posts_id=post[0].id)
    apps_additional = additional.objects.filter(id_posts_id=post[0].id)

    slug = SubCategory.objects.filter(name=apps_details[0].category)

    if slug[0].link == "vr_top_device_featured_category":
        url = "https://play.google.com/store/apps/stream/"+slug[0].link+"?hl=en"
    elif slug[0].link == "FAMILY_AGE_RANGE1":
        url = "https://play.google.com/store/apps/category/FAMILY?age=AGE_RANGE1&hl=en"
    elif slug[0].link == "FAMILY_AGE_RANGE2":
        url = "https://play.google.com/store/apps/category/FAMILY?age=AGE_RANGE2&hl=en"
    elif slug[0].link == "FAMILY_AGE_RANGE3":
        url = "https://play.google.com/store/apps/category/FAMILY?age=AGE_RANGE3&hl=en"
    else:
        url = "https://play.google.com/store/apps/category/"+slug[0].link+"?hl=en"

    title = None

    if post[0].version == "varies_with_device":
        title = "Download "+post[0].title+" For Android - Apps on "+settings.APP_NAME
    else:
        title = "Download "+post[0].title+" "+post[0].version+" For Android - Apps on "+settings.APP_NAME

    data = {
        "appName": settings.APP_NAME,
        "appTitle": title,
        "name": "apps",
        "post": post,
        "details": apps_details,
        "screenshot": apps_ss[0].image.split(','),
        "additional": apps_additional[0].name.split(','),
        "subcategory": SubCategory.objects.all().filter(id_subcategory=1),
        "sidebar": "./sidebars/sidebar_apps.html",
        "current_url": request.build_absolute_uri,
        "array": homeviews.scraping(url),
    }

    return render_to_response("posts/post_apps.html",data)