Giter VIP home page Giter VIP logo

coldfusion-blog-aggregator's People

Contributors

cfjedimaster avatar jsieber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coldfusion-blog-aggregator's Issues

Daily email of top clicks is emailing about entries from 2007...

For example, these are the links from last night's email (in the order in which the email contained them):

There are a couple of things about this that are potentially fishy. Could you check the click data and make sure they really were clicked? E.g. the first one was clicked 6 times?

With the exception of the two recent Adam Cameron links, they're all from WebDevelopmentCentral.com, and published in 2007. Could this be someone trying to increase traffic (for ad revenue?) through automated clicks or even simply human-powered searching and clicking? I find it odd that all of the WDC links are Flex-related.

It's also possible that these are clicks from a spider...

I realize that it's possible that these entries are getting recent clicks (for god knows what reason...), so I took a look at the code...

scheduled job, selecting top entries: https://github.com/cfjedimaster/ColdFusion-Blog-Aggregator/blob/master/scheduled/dailyemail.cfm#L22

<cfset onedayago = dateAdd("d", -1, now())>
<cfset topentries = application.entries.getTopEntries(onedayago)>

getTopEntries: https://github.com/cfjedimaster/ColdFusion-Blog-Aggregator/blob/master/components/entries.cfc#L316

<cffunction name="getTopEntries" access="public" returnType="query" output="false">
    <cfargument name="dateafter" type="date" required="false" hint="If passed, clicks must be after.">
    <cfset var q = "">

    <cfquery name="q" datasource="#variables.dsn#">
    select  cl.entryidfk, count(cl.entryidfk) as total,
            e.title, e.url, b.name as blog, b.url as blogurl
    from    click_log cl, entries e, blogs b
    where   cl.entryidfk = e.id
    and     e.blogidfk = b.id
    <cfif structKeyExists(arguments,"dateafter")>
    and     e.created > <cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.dateafter#">
    </cfif>
    group by entryidfk
    order by total desc
    limit 0,10
    </cfquery>

    <cfreturn q>
</cffunction>

This seems reasonable for the most part. On the surface it looks like you're limiting on entry date. The comma-join bothers me a bit. I don't use them, in favor of explicitly defining inner/left/etc joins (because they're going away). But given that the email includes only recent entries some of the time, but occasionally ancient links, I'm guessing there's an edge case here. Possibly when there were no clicks on the previous day to report?

If you check the click data and these 2007 entries did actually get clicks yesterday (2013-08-31), then it's probably got nothing to do with the SQL join. If there are no recorded clicks for these entries that happened yesterday then I'd say it's time to switch to inner joins. I've got the change made in a branch, and could very easily send you a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.