Exemplo n.º 1
0
        public allResults gatherAllData(string inputkeyword)
        {
            allResults allData     = new allResults();
            float      competition = -1;

            try
            {
                //fetch results page for desired keyword ONE time to prevent bans
                //Note: SEOTC is a completely separate search (intitle: keyword)
                string resultsPage = getSERP(inputkeyword);

                //get top 10 urls
                List <string> top10 = getTop10(resultsPage);

                //this will store the urls plus the extra information we need
                List <topSite> top10Details = new List <topSite>();

                foreach (string site in top10)
                {
                    topSite newSite = new topSite();
                    newSite.setPR(fetchPR(site));
                    newSite.setAge(fetchDA(site));
                    newSite.setURL(site);
                    //newSite.setBacklinks =
                    newSite.setDmozListed(checkDMOZ(site));

                    top10Details.Add(newSite);
                }

                //analyze keyword counts for every site in top 10
                top10Details = analyzeKeywordCount(top10Details, inputkeyword);

                keyword keyword = new keyword();
                keyword.setName(inputkeyword);
                keyword.setSeoc(fetchSEOC(keyword.getName()));
                keyword.setSeotc(fetchSEOTC(keyword.getName()));

                allData.setKeyword(keyword);
                allData.setTop10(top10Details);

                //competition = analyzeComp(top10Details, inputkeyword);
            }
            catch (Exception ex)
            {
            }

            return(allData);
        }
Exemplo n.º 2
0
 public void setKeyword(keyword keyword)
 {
     keyword_ = keyword;
 }
Exemplo n.º 3
0
        public allResults gatherAllData(string inputkeyword)
        {
            allResults allData = new allResults();
            float competition = -1;

            try
            {
                //fetch results page for desired keyword ONE time to prevent bans
                //Note: SEOTC is a completely separate search (intitle: keyword)
                string resultsPage = getSERP(inputkeyword);

                //get top 10 urls
                List<string> top10 = getTop10(resultsPage);

                //this will store the urls plus the extra information we need
                List<topSite> top10Details = new List<topSite>();

                foreach (string site in top10)
                {
                    topSite newSite = new topSite();
                    newSite.setPR(fetchPR(site));
                    newSite.setAge(fetchDA(site));
                    newSite.setURL(site);
                    //newSite.setBacklinks =
                    newSite.setDmozListed(checkDMOZ(site));

                    top10Details.Add(newSite);
                }

                //analyze keyword counts for every site in top 10
                top10Details = analyzeKeywordCount(top10Details, inputkeyword);

                keyword keyword = new keyword();
                keyword.setName(inputkeyword);
                keyword.setSeoc(fetchSEOC(keyword.getName()));
                keyword.setSeotc(fetchSEOTC(keyword.getName()));

                allData.setKeyword(keyword);
                allData.setTop10(top10Details);

                //competition = analyzeComp(top10Details, inputkeyword);
            }
            catch (Exception ex)
            {

            }

            return allData;
        }
Exemplo n.º 4
0
        //***analyzeComp() details***
        //===========================
        //Here we will determine an estimation of how difficult it will be to rank for a certain keyword.
        //For now we will keep it simple and only analyze a few metrics:
        //Domain Age         - How long the domain been registered for
        //Page Rank (PR)     - Google's page rank for the top 10 site
        //SEO Comp (SEOC)    - The total number of webpages GLOBALLY that mention the same keyword term
        //                     in the same (phrase) word order, in Bing's index. [AS DESCRIBED IN MARKET SAMURAI]
        //Title Comp (SEOTC) - The total number of webpages GLOBALLY that mention all of the words in a keyword
        //                     term in the title of a page. [AS DESCRIBED IN MARKET SAMURAI]
        //Possible other metrics to determine rank to be implemented:
        //Search for sites such as blogger, yahoo answers or similar sites that are easy to beat
        //Search for certain top level domains (TLDs) which are difficult to beat such as .gov and .edu
        //With any extra time, we will add more metrics to take a look at, but for now, this should be enough to get
        //a general overview of how difficult it might be to rank for the desired keyword.
        //We will be using a simple scale between 1 and 10 to determine difficulty. Higher domain age/competition will add points,
        //meaning a higher difficulty.
        //We will get a score between 1 to 10 for each metric and then get an average between them.
        //The ranks will be as follows:
        //1    - Incredibly easy - Probably instant rankings
        //2    - Easy            - Little work necessary to rank
        //3-5  - Medium          - You should have some SEO knowledge to rank for these keywords
        //6-8  - Hard            - Probably a long time endeavour to rank for this keyword. Major SEO/time needed
        //9-10 - Impossible      - Probably not worth your time
        //===================================================================================
        //          ***Update notes as of Monday, Oct 29th 2012(Sprint 2):***
        //===================================================================================
        //A new ranking system will be needed as the current one does not work as intended.
        //In this new system, each metric will have an associated "weight".
        //This is because some metrics are more important than others.
        public float analyzeComp(List<topSite> top10, keyword keyword)
        {
            keywordMetrics newKeywordMetrics = new keywordMetrics();
            float compScore = -1;

            try
            {
                //get average pr/domain age from top10
                int avgPR = 0;
                int avgDA = 0;

                foreach (topSite site in top10)
                {
                    if (site.getPR() > 0) //dont add negative prs cause by errors
                        avgPR += site.getPR();

                    avgDA += site.getAge();

                    //SPRINT 3====================================
                    //more important metrics are tallied differently
                    if (site.getDmozListed() == true)
                        newKeywordMetrics.setDmozListedScore(newKeywordMetrics.getDmozListedScore() + 1);

                    if (site.getIsEMD() == true)
                        newKeywordMetrics.setIsEMDScoreScore(newKeywordMetrics.getIsEMDScoreScore() + 3); //3 for emd

                    if (site.getKeywordInMeta() == true)
                        newKeywordMetrics.setKeywordInMetaScore(newKeywordMetrics.getKeywordInMetaScore() + 1);

                    if (site.getKeywordInTitle() == true)
                        newKeywordMetrics.setKeywordInTitleScore(newKeywordMetrics.getKeywordInTitleScore() + 3); //3 for title

                    if (site.getKeywordInURL() == true)
                        newKeywordMetrics.setKeywordInURLScore(newKeywordMetrics.getKeywordInURLScore() + 1);
                    //END SPRINT 3================================
                }

                avgPR = avgPR / top10.Count;
                avgDA = avgDA / top10.Count;

                //pr comp
                newKeywordMetrics.setPrScore(avgPR);

                //da comp
                if (avgDA >= 10)
                    newKeywordMetrics.setDaScore(10);
                else
                    newKeywordMetrics.setDaScore(avgDA);

                //seoc comp
                if (keyword.getSeoc() >= 1000000)
                    newKeywordMetrics.setSeocScore(10);
                else if (keyword.getSeoc() >= 500000)
                    newKeywordMetrics.setSeocScore(8);
                else if (keyword.getSeoc() >= 250000)
                    newKeywordMetrics.setSeocScore(6);
                else if (keyword.getSeoc() >= 100000)
                    newKeywordMetrics.setSeocScore(4);
                else if (keyword.getSeoc() >= 60000)
                    newKeywordMetrics.setSeocScore(2);
                else if (keyword.getSeoc() >= 30000)
                    newKeywordMetrics.setSeocScore(1);
                else
                    newKeywordMetrics.setSeocScore(0);

                //seotc comp
                if (keyword.getSeotc() >= 100000)
                    newKeywordMetrics.setSeotcScore(10);
                else if (keyword.getSeotc() >= 50000)
                    newKeywordMetrics.setSeotcScore(8);
                else if (keyword.getSeotc() >= 25000)
                    newKeywordMetrics.setSeotcScore(6);
                else if (keyword.getSeotc() >= 10000)
                    newKeywordMetrics.setSeotcScore(4);
                else if (keyword.getSeotc() >= 6000)
                    newKeywordMetrics.setSeotcScore(2);
                else if (keyword.getSeotc() >= 3000)
                    newKeywordMetrics.setSeotcScore(1);
                else
                    newKeywordMetrics.setSeotcScore(0);

                //max percentage for each metric variables

                //SPRINT 3 NOTE
                //Because of the way competition can be judged, the total percentages will exceed 100
                //This is because if a certain metrics FAR outweighs all the rest, the site could be ranking
                //based on that metric alone.

                float maxPrScore = 5;
                float maxDaScore = 15;
                float maxSeocScore = 10;
                float maxSeotcScore = 20;

                //sprint 3 percentages
                float maxDmozScore = 10;
                float maxEMDScore = 10;
                float maxMetaScore = 5;
                float maxTitleScore = 20;
                float maxURLScore = 5;

                //get competition
                compScore = newKeywordMetrics.getPrScore() * (maxPrScore / 100) +
                                newKeywordMetrics.getDaScore() * (maxDaScore / 100) +
                                newKeywordMetrics.getSeocScore() * (maxSeocScore / 100) +
                                newKeywordMetrics.getSeotcScore() * (maxSeotcScore / 100) +
                                newKeywordMetrics.getDmozListedScore() * (maxDmozScore / 100) +
                                newKeywordMetrics.getIsEMDScoreScore() * (maxEMDScore / 100) +
                                newKeywordMetrics.getKeywordInMetaScore() * (maxMetaScore / 100) +
                                newKeywordMetrics.getKeywordInTitleScore() * (maxTitleScore / 100) +
                                newKeywordMetrics.getKeywordInURLScore() * (maxURLScore / 100);
            }
            catch (Exception ex)
            {
                compScore = -1;
            }

            return compScore;
        }
Exemplo n.º 5
0
 public void setKeyword(keyword keyword)
 {
     keyword_ = keyword;
 }
Exemplo n.º 6
0
        }//end getTop10

        //***analyzeComp() details***
        //===========================

        //Here we will determine an estimation of how difficult it will be to rank for a certain keyword.

        //For now we will keep it simple and only analyze a few metrics:
        //Domain Age         - How long the domain been registered for
        //Page Rank (PR)     - Google's page rank for the top 10 site
        //SEO Comp (SEOC)    - The total number of webpages GLOBALLY that mention the same keyword term
        //                     in the same (phrase) word order, in Bing's index. [AS DESCRIBED IN MARKET SAMURAI]
        //Title Comp (SEOTC) - The total number of webpages GLOBALLY that mention all of the words in a keyword
        //                     term in the title of a page. [AS DESCRIBED IN MARKET SAMURAI]

        //Possible other metrics to determine rank to be implemented:
        //Search for sites such as blogger, yahoo answers or similar sites that are easy to beat
        //Search for certain top level domains (TLDs) which are difficult to beat such as .gov and .edu

        //With any extra time, we will add more metrics to take a look at, but for now, this should be enough to get
        //a general overview of how difficult it might be to rank for the desired keyword.

        //We will be using a simple scale between 1 and 10 to determine difficulty. Higher domain age/competition will add points,
        //meaning a higher difficulty.

        //We will get a score between 1 to 10 for each metric and then get an average between them.

        //The ranks will be as follows:
        //1    - Incredibly easy - Probably instant rankings
        //2    - Easy            - Little work necessary to rank
        //3-5  - Medium          - You should have some SEO knowledge to rank for these keywords
        //6-8  - Hard            - Probably a long time endeavour to rank for this keyword. Major SEO/time needed
        //9-10 - Impossible      - Probably not worth your time

        //===================================================================================
        //          ***Update notes as of Monday, Oct 29th 2012(Sprint 2):***
        //===================================================================================
        //A new ranking system will be needed as the current one does not work as intended.
        //In this new system, each metric will have an associated "weight".
        //This is because some metrics are more important than others.
        public float analyzeComp(List <topSite> top10, keyword keyword)
        {
            keywordMetrics newKeywordMetrics = new keywordMetrics();
            float          compScore         = -1;

            try
            {
                //get average pr/domain age from top10
                int avgPR = 0;
                int avgDA = 0;

                foreach (topSite site in top10)
                {
                    if (site.getPR() > 0) //dont add negative prs cause by errors
                    {
                        avgPR += site.getPR();
                    }

                    avgDA += site.getAge();

                    //SPRINT 3====================================
                    //more important metrics are tallied differently
                    if (site.getDmozListed() == true)
                    {
                        newKeywordMetrics.setDmozListedScore(newKeywordMetrics.getDmozListedScore() + 1);
                    }

                    if (site.getIsEMD() == true)
                    {
                        newKeywordMetrics.setIsEMDScoreScore(newKeywordMetrics.getIsEMDScoreScore() + 3); //3 for emd
                    }
                    if (site.getKeywordInMeta() == true)
                    {
                        newKeywordMetrics.setKeywordInMetaScore(newKeywordMetrics.getKeywordInMetaScore() + 1);
                    }

                    if (site.getKeywordInTitle() == true)
                    {
                        newKeywordMetrics.setKeywordInTitleScore(newKeywordMetrics.getKeywordInTitleScore() + 3); //3 for title
                    }
                    if (site.getKeywordInURL() == true)
                    {
                        newKeywordMetrics.setKeywordInURLScore(newKeywordMetrics.getKeywordInURLScore() + 1);
                    }
                    //END SPRINT 3================================
                }

                avgPR = avgPR / top10.Count;
                avgDA = avgDA / top10.Count;

                //pr comp
                newKeywordMetrics.setPrScore(avgPR);

                //da comp
                if (avgDA >= 10)
                {
                    newKeywordMetrics.setDaScore(10);
                }
                else
                {
                    newKeywordMetrics.setDaScore(avgDA);
                }

                //seoc comp
                if (keyword.getSeoc() >= 1000000)
                {
                    newKeywordMetrics.setSeocScore(10);
                }
                else if (keyword.getSeoc() >= 500000)
                {
                    newKeywordMetrics.setSeocScore(8);
                }
                else if (keyword.getSeoc() >= 250000)
                {
                    newKeywordMetrics.setSeocScore(6);
                }
                else if (keyword.getSeoc() >= 100000)
                {
                    newKeywordMetrics.setSeocScore(4);
                }
                else if (keyword.getSeoc() >= 60000)
                {
                    newKeywordMetrics.setSeocScore(2);
                }
                else if (keyword.getSeoc() >= 30000)
                {
                    newKeywordMetrics.setSeocScore(1);
                }
                else
                {
                    newKeywordMetrics.setSeocScore(0);
                }

                //seotc comp
                if (keyword.getSeotc() >= 100000)
                {
                    newKeywordMetrics.setSeotcScore(10);
                }
                else if (keyword.getSeotc() >= 50000)
                {
                    newKeywordMetrics.setSeotcScore(8);
                }
                else if (keyword.getSeotc() >= 25000)
                {
                    newKeywordMetrics.setSeotcScore(6);
                }
                else if (keyword.getSeotc() >= 10000)
                {
                    newKeywordMetrics.setSeotcScore(4);
                }
                else if (keyword.getSeotc() >= 6000)
                {
                    newKeywordMetrics.setSeotcScore(2);
                }
                else if (keyword.getSeotc() >= 3000)
                {
                    newKeywordMetrics.setSeotcScore(1);
                }
                else
                {
                    newKeywordMetrics.setSeotcScore(0);
                }

                //max percentage for each metric variables

                //SPRINT 3 NOTE
                //Because of the way competition can be judged, the total percentages will exceed 100
                //This is because if a certain metrics FAR outweighs all the rest, the site could be ranking
                //based on that metric alone.

                float maxPrScore    = 5;
                float maxDaScore    = 15;
                float maxSeocScore  = 10;
                float maxSeotcScore = 20;

                //sprint 3 percentages
                float maxDmozScore  = 10;
                float maxEMDScore   = 10;
                float maxMetaScore  = 5;
                float maxTitleScore = 20;
                float maxURLScore   = 5;

                //get competition
                compScore = newKeywordMetrics.getPrScore() * (maxPrScore / 100) +
                            newKeywordMetrics.getDaScore() * (maxDaScore / 100) +
                            newKeywordMetrics.getSeocScore() * (maxSeocScore / 100) +
                            newKeywordMetrics.getSeotcScore() * (maxSeotcScore / 100) +
                            newKeywordMetrics.getDmozListedScore() * (maxDmozScore / 100) +
                            newKeywordMetrics.getIsEMDScoreScore() * (maxEMDScore / 100) +
                            newKeywordMetrics.getKeywordInMetaScore() * (maxMetaScore / 100) +
                            newKeywordMetrics.getKeywordInTitleScore() * (maxTitleScore / 100) +
                            newKeywordMetrics.getKeywordInURLScore() * (maxURLScore / 100);
            }
            catch (Exception ex)
            {
                compScore = -1;
            }

            return(compScore);
        }