cfjedimaster / coldfusion-blog-aggregator Goto Github PK
View Code? Open in Web Editor NEWColdFusion code to quickly create a blog aggregator
ColdFusion code to quickly create a blog aggregator
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.
The twitter posts are no longer working as of June 11th, 2013. I tried updating to the twitter4j-core-3.0.4-SNAPSHOT.jar, but i;m having issues calling the setOAuthConsumer method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.