Android Open Source - android-furk-app Furk Service Guide Extension






From Project

Back to project page android-furk-app.

License

The source code is released under:

Apache License

If you think the Android project android-furk-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.simple.furk;
import android.content.Intent;
import android.net.Uri;
import android.text.Html;
// w  w  w  .j  a  va 2s . c o  m
import com.battlelancer.seriesguide.api.Action;
import com.battlelancer.seriesguide.api.Episode;
import com.battlelancer.seriesguide.api.SeriesGuideExtension;

import java.net.URLEncoder;

public class FurkServiceGuideExtension extends SeriesGuideExtension {

    public FurkServiceGuideExtension() {
        super("FurkExtension");
    }

    @Override
    protected void onRequest(int episodeIdentifier, Episode episode) {

        Intent intent = new Intent(this, MainActivity.class);
        intent.setAction("com.simple.furk.TORRENT_SEARCH");
        String query = buildEpisodeQuery(episode);
        String episodeURI =  "http://kickass.to/usearch/" + URLEncoder.encode(query) + "/?field=seeders&sorder=desc&rss=1";
        intent.setData(Uri.parse(episodeURI));
        intent.putExtra("query",query);
        publishAction(new Action.Builder("Furk.net search", episodeIdentifier)
                .viewIntent(intent)
                .build());
    }

    private String buildEpisodeQuery(Episode episode) {
        String query = episode.getShowTitle() +" S";

        if(episode.getSeason() > 9)
            query += episode.getSeason().toString();
        else
            query += "0"+episode.getSeason().toString();

        query += "E";

        if(episode.getNumber() > 9)
            query += episode.getNumber().toString();
        else
            query += "0"+episode.getNumber().toString();

        return query;
    }

}




Java Source Code List

com.simple.furk.APIClient.java
com.simple.furk.APIUtils.java
com.simple.furk.FileActivity.java
com.simple.furk.FurkServiceGuideExtension.java
com.simple.furk.Furk.java
com.simple.furk.LogExceptionHandler.java
com.simple.furk.LoginActivity.java
com.simple.furk.MainActivity.java
com.simple.furk.NavigationDrawerFragment.java
com.simple.furk.SearchActivity.java
com.simple.furk.SettingsActivity.java
com.simple.furk.adapter.ActiveFilesAdapter.java
com.simple.furk.adapter.FilesAdapter.java
com.simple.furk.adapter.MyFilesAdapter.java
com.simple.furk.adapter.SearchFilesAdapter.java
com.simple.furk.adapter.TFilesAdapter.java