Examples of Technorati


Examples of org.apache.roller.planet.util.Technorati

       
        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = PlanetFactory.getPlanet().getPlanetManager();
            Technorati technorati = null;
            try {
                String proxyHost = PlanetRuntimeConfig.getProperty("site.proxyhost");
                int proxyPort = PlanetRuntimeConfig.getIntProperty("site.proxyport");
                if (proxyHost != null && proxyPort != -1) {
                    technorati = new Technorati(proxyHost, proxyPort);
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                log.error("Aborting collection of Technorati rankings.\n"
                        +"technorati.license not found at root of classpath.\n"
                        +"Get license at http://technorati.com/developers/apikey.html\n"
                        +"Put the license string in a file called technorati.license.\n"
                        +"And place that file at the root of Roller's classpath.\n"
                        +"For example, in the /WEB-INF/classes directory.");
                return;
            }
           
            try {
                int limit = PlanetConfig.getIntProperty(
                        "planet.aggregator.technorati.limit", 500);
                int userCount = planet.getSubscriptionCount();
                int mod = (userCount / limit) + 1;
               
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                int day = cal.get(Calendar.DAY_OF_YEAR);
               
                int start = (day % mod) * limit;
                int end = start + limit;
                end = end > userCount ? userCount : end;
                log.info("Updating subscriptions ["+start+":"+end+"]");
               
                Iterator subs = planet.getSubscriptions().iterator();
                while (subs.hasNext()) {
                    Subscription sub =
                            (Subscription)subs.next();
                    if (count >= start && count < end) {
                        try {
                            Technorati.Result result =
                                    technorati.getBloginfo(sub.getSiteURL());
                            if (result != null && result.getWeblog() != null) {
                                sub.setInboundblogs(
                                        result.getWeblog().getInboundblogs());
                                sub.setInboundlinks(
                                        result.getWeblog().getInboundlinks());
View Full Code Here

Examples of org.apache.roller.util.Technorati

        int inboundlinks = -1;
        int inboundblogs = -1;
        if (form.getSiteUrl()!=null && form.getSiteUrl().trim().length() > 0) {
            try {
                PlanetConfigData config = planet.getConfiguration();
                Technorati technorati = null;
                if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
                Technorati.Result result =
                        technorati.getBloginfo(form.getSiteUrl());
                technoratiTitle = result.getWeblog().getName();
                technoratiFeedUrl = result.getWeblog().getRssurl();
                form.setInboundlinks(result.getWeblog().getInboundlinks());
                form.setInboundblogs(result.getWeblog().getInboundblogs());
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.roller.util.Technorati

        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = roller.getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            Technorati technorati = null;
            try {
                if (config.getProxyHost()!=null && config.getProxyPort() != -1) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                logger.error("Aborting collection of Technorati rankings.\n"
                +"technorati.license not found at root of classpath.\n"
                +"Get license at http://technorati.com/developers/apikey.html\n"
                +"Put the license string in a file called technorati.license.\n"
                +"And place that file at the root of Roller's classpath.\n"
                +"For example, in the /WEB-INF/classes directory.");
                return;
            }
            UserManager userManager = roller.getUserManager();
            try {
                int limit = RollerConfig.getIntProperty(
                    "planet.aggregator.technorati.limit", 500);
                int userCount = planet.getSubscriptionCount();
                int mod = (userCount / limit) + 1;
               
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                int day = cal.get(Calendar.DAY_OF_YEAR);
               
                int start = (day % mod) * limit;
                int end = start + limit;
                end = end > userCount ? userCount : end;
                logger.info("Updating subscriptions ["+start+":"+end+"]");
               
                Iterator subs = planet.getAllSubscriptions();
                while (subs.hasNext()) {
                    PlanetSubscriptionData sub =
                            (PlanetSubscriptionData)subs.next();
                    if (count >= start && count < end) {
                        try {
                            Technorati.Result result =
                                    technorati.getBloginfo(sub.getSiteUrl());
                            if (result != null && result.getWeblog() != null) {
                                sub.setInboundblogs(
                                        result.getWeblog().getInboundblogs());
                                sub.setInboundlinks(
                                        result.getWeblog().getInboundlinks());
View Full Code Here

Examples of org.apache.roller.util.Technorati

        int inboundlinks = -1;
        int inboundblogs = -1;
        if (form.getSiteURL()!=null && form.getSiteURL().trim().length() > 0) {
            try {
                PlanetConfigData config = planet.getConfiguration();
                Technorati technorati = null;
                if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
                Technorati.Result result =
                        technorati.getBloginfo(form.getSiteURL());
                technoratiTitle = result.getWeblog().getName();
                technoratiFeedUrl = result.getWeblog().getRssurl();
                form.setInboundlinks(result.getWeblog().getInboundlinks());
                form.setInboundblogs(result.getWeblog().getInboundblogs());
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.roller.util.Technorati

        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            Technorati technorati = null;
            try {
                if (config.getProxyHost()!=null && config.getProxyPort() != -1) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                log.error("Aborting collection of Technorati rankings.\n"
                        +"technorati.license not found at root of classpath.\n"
                        +"Get license at http://technorati.com/developers/apikey.html\n"
                        +"Put the license string in a file called technorati.license.\n"
                        +"And place that file at the root of Roller's classpath.\n"
                        +"For example, in the /WEB-INF/classes directory.");
                return;
            }
           
            UserManager userManager = RollerFactory.getRoller().getUserManager();
            try {
                int limit = RollerConfig.getIntProperty(
                        "planet.aggregator.technorati.limit", 500);
                int userCount = planet.getSubscriptionCount();
                int mod = (userCount / limit) + 1;
               
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                int day = cal.get(Calendar.DAY_OF_YEAR);
               
                int start = (day % mod) * limit;
                int end = start + limit;
                end = end > userCount ? userCount : end;
                log.info("Updating subscriptions ["+start+":"+end+"]");
               
                Iterator subs = planet.getAllSubscriptions();
                while (subs.hasNext()) {
                    PlanetSubscriptionData sub =
                            (PlanetSubscriptionData)subs.next();
                    if (count >= start && count < end) {
                        try {
                            Technorati.Result result =
                                    technorati.getBloginfo(sub.getSiteURL());
                            if (result != null && result.getWeblog() != null) {
                                sub.setInboundblogs(
                                        result.getWeblog().getInboundblogs());
                                sub.setInboundlinks(
                                        result.getWeblog().getInboundlinks());
View Full Code Here

Examples of org.apache.roller.util.Technorati

        int inboundlinks = -1;
        int inboundblogs = -1;
        if (form.getSiteURL()!=null && form.getSiteURL().trim().length() > 0) {
            try {
                PlanetConfigData config = planet.getConfiguration();
                Technorati technorati = null;
                if (config.getProxyHost()!=null && config.getProxyPort() > 0) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
                Technorati.Result result =
                        technorati.getBloginfo(form.getSiteURL());
                technoratiTitle = result.getWeblog().getName();
                technoratiFeedUrl = result.getWeblog().getRssurl();
                form.setInboundlinks(result.getWeblog().getInboundlinks());
                form.setInboundblogs(result.getWeblog().getInboundblogs());
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.roller.util.Technorati

        int count = 0;
        int errorCount = 0;
        try {
            PlanetManager planet = RollerFactory.getRoller().getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            Technorati technorati = null;
            try {
                if (config.getProxyHost()!=null && config.getProxyPort() != -1) {
                    technorati = new Technorati(
                            config.getProxyHost(), config.getProxyPort());
                } else {
                    technorati = new Technorati();
                }
            } catch (IOException e) {
                log.error("Aborting collection of Technorati rankings.\n"
                        +"technorati.license not found at root of classpath.\n"
                        +"Get license at http://technorati.com/developers/apikey.html\n"
                        +"Put the license string in a file called technorati.license.\n"
                        +"And place that file at the root of Roller's classpath.\n"
                        +"For example, in the /WEB-INF/classes directory.");
                return;
            }
           
            UserManager userManager = RollerFactory.getRoller().getUserManager();
            try {
                int limit = RollerConfig.getIntProperty(
                        "planet.aggregator.technorati.limit", 500);
                int userCount = planet.getSubscriptionCount();
                int mod = (userCount / limit) + 1;
               
                Calendar cal = Calendar.getInstance();
                cal.setTime(new Date());
                int day = cal.get(Calendar.DAY_OF_YEAR);
               
                int start = (day % mod) * limit;
                int end = start + limit;
                end = end > userCount ? userCount : end;
                log.info("Updating subscriptions ["+start+":"+end+"]");
               
                Iterator subs = planet.getAllSubscriptions();
                while (subs.hasNext()) {
                    PlanetSubscriptionData sub =
                            (PlanetSubscriptionData)subs.next();
                    if (count >= start && count < end) {
                        try {
                            Technorati.Result result =
                                    technorati.getBloginfo(sub.getSiteURL());
                            if (result != null && result.getWeblog() != null) {
                                sub.setInboundblogs(
                                        result.getWeblog().getInboundblogs());
                                sub.setInboundlinks(
                                        result.getWeblog().getInboundlinks());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.