Friday, July 3, 2015

Turning a Crawled Website into a Search Engine with PHP

In the previous part of this tutorial, we used Diffbot to set up a crawljob which would eventually harvest SitePoint’s content into a data collection, fully searchable by Diffbot’s Search API. We also demonstrated those searching capabilities by applying some common filters and listing the results.

Diffbot Logo

In this part, we’ll build a GUI simple enough for the average Joe to use it, in order to have a relatively pretty, functional, and lightweight but detailed SitePoint search engine. What’s more, we won’t be using a framework, but a mere total of three libraries to build the entire application.

You can see the demo application here.

This tutorial is completely standalone, and as such if you choose to follow along, you can start with a fresh Homestead Improved instance. Note that in order to actually fully use what we build, you need a Diffbot account with Crawljob and Search API functionality.

Bootstrapping

Moving on, I’ll assume you’re using a Vagrant machine. If not, find out why you should, then come back.

On a fresh Homestead Improved VM, the bootstrapping procedure is as follows:

composer global require beelab/bowerphp:dev-master
mkdir sp_search
cd sp_search
mkdir public cache template template/twig app
composer require swader/diffbot-php-client
composer require twig/twig
composer require symfony/var-dumper --dev

In order, this:

  • installs BowerPHP globally, so we can use it on the entire VM.
  • creates the project’s root folder and several subfolders.
  • installs the Diffbot PHP client, which we’ll use to make all calls to the API and to iterate through the results.
  • installs the Twig templating engine, so we’re not echoing out HTML in PHP like peasants :)
  • installs VarDumper in dev mode, so we can easily debug while developing.

Continue reading %Turning a Crawled Website into a Search Engine with PHP%


by Bruno Skvorc via SitePoint

Confessions of a SitePoint Editor

I’ve been writing since before it was cool. I discovered my passion at the ripe age of 20. It started in 2010, when I admitted I hated my college major. I applied for a spot in University of Central Florida’s (UCF) journalism program. Shortly after, I was accepted. And shortly after that, I failed my […]

Continue reading %Confessions of a SitePoint Editor%


by Lauren Holliday via SitePoint

Implementing Lazy Enumerables in Ruby

Darwin and the Art of Web Design

Once upon a time there was a man called Darwin. This man came up with an idea that has come to be known as ‘the survival of the fittest’.

This is probably one of the most misused terms in history, but the concept is based on his theory of natural selection, and it is natural selection that I believe can be applied to web design to create better and more usable websites and web applications.

Natural selection is the idea that something (in Darwin's case, some population of animals or plants) will change, as environmental conditions change.

Change in this context means they are somehow better adapted to that new environment, which then means that they can reproduce more and so propagate their traits (or features and elements in the case of web design). This then ultimately results in that changed version of the species becoming successful.

I believe this fundamental concept of adaptation to changing environments making more successful, better-adapted species can also be applied to web design.

This is not an article about how to design your website and which design elements to use, it is more about an approach to web design, based as much on science as art.

Applying Darwinism to Web Design

Constraints and Trade-offs

Just like in the natural world, a number of variables constitute the ‘environment’ in Darwinian web design. Within any environment there exist constraints. These constraints result in a trade-off in one way or another.

A brilliant example in the natural world is the tail of the peacock. While his extravagant tail attracts many prospective mates, making it easy to pass on his genes, at the same time that heavy, flashy tail is a serious burden when it comes to eluding predators.

There is a trade-off between the tail's attractiveness for females and the survival of the bird itself.

In the digital world these trade offs are built around design variables. You need to understand what these variables are so you can work to optimize them against each other and any other constraints. Map out what makes up your current working environment before beginning your design outline.

The Variables of Design

The most obvious variable you need to define is your audience. The demographic of an audience can dictate various aspects of web design, including the level of accessibility and tone of the copy. Your audience may constrain the design.

For instance, a very young audience may dictate the tone of your copy. Other variables include the technical constraints of the underlying application (if you are building a web front end) or the limitations of HTML itself and your editing tool choice at the time of design.

Further variables might be the types of devices you need to consider in your design.

For a project aimed at high-end designers, you may be able to focus on desktop / laptop sized screen sizes. On the other hand, if you’re designing for a broad, mass market site, then you really need to be responsive to all kinds of devices and connections. The recent mobilegeddon debacle, where Google has begun to rank responsive websites more highly has also made responsive design a must.

Whatever your particular design criteria, know them first so that you understand the constraints and advantages of your ecosystem.

Otherwise you'll be the prettiest dead peacock in town.

Continue reading %Darwin and the Art of Web Design%


by Martin May via SitePoint

Create a Custom API in Magento: Part Two

This week's JavaScript news, issue 239

Eich on WebAssembly, TCO, native vs Underscore, a look at React's performance, and more.
Read this e-mail on the Web
JavaScript Weekly
Issue 239 — July 3, 2015
Eric Elliott discusses the details of the recently announced ‘WebAssembly’ with JavaScript’s creator.
Eric Elliott

Axel goes into some depth to explain what TCO is, how ES6 offers it, and what benefits it provides.
Dr. Axel Rauschmayer

A look at performing typical Underscore supplied operations using native ES5, ES5.1, ES6/ES2015 and ES7/2016.
Reindex

Build full stack apps in JS with Scott Moss:
- 2-Days on Angular, Components and ES6
- 3-Days on API Design in Node.js
Join us (all or part) of the week July 20-25th!
Frontend Masters   Sponsored
Frontend Masters

A sort of gamedev answer to TodoMVC where the same Breakout game is implemented on 12 different JavaScript game frameworks so you can compare them.
Matt Greer

“LOC is pretty much irrelevant. It doesn’t matter if the module is one line or hundreds. It’s all about containing complexity.”
Sindre Sorhus

Sebastian McKenzie, creator of Babel, gave a talk at JSConf on how JavaScript transformation and ES6 can help improve developer workflow and how it can futureproof your code.
JSConf

Angular core team member Marcy Sutton talks about testing accessibility automatically using JavaScript in just 30 minutes, but will she get the pizza she ordered?
Marcy Sutton

Google’s Paul Lewis noodled with React to see how it held up performance wise and noted ‘for mobile there’s a remarkable cost to using React over not doing so, and the cost is so high as to be reasonably prohibitive.’
Paul Lewis

With 0.14, the main ‘react’ package is splitting into two: react and react-dom. The way DOM references are exposed is also changing.
Facebook

A look at the performance implications of using ES6 (the next version of JavaScript, essentially) specific features.
Kevin Decker

Jobs

  • JavaScript Engineer — London UK — Improbable.ioMaking understanding complexity an intuitive practice. Building out a suite of applications giving the world access to our core simulation technology. Develop tooling, lead framework / library selection & develop large scale, high performance apps.
    Improbable.io
  • JavaScript Developer at Backbase (Amsterdam)Unique fast growing startup - like company, powerful software products, awesome international peers. Come work with us in Amsterdam! The momentum is here now. No BS, just watch it: Working at Backbase
    Backbase
  • Apply to the best startups in SF & NYC in 60 secondsOne of every two companies that attempt to join Underdog.io is turned away. Apply as a candidate, and founders & hiring managers email you directly. No middlemen & no placement fees for companies.
    Underdog.io

In brief

Curated by Peter Cooper and published by Cooper Press.

Stop getting JavaScript Weekly : Change email address : Read this issue on the Web

© Cooper Press Ltd. Office 30, Lincoln Way, Louth, LN11 0LS, UK


by via JavaScript Weekly

YouTube Community Development: How to Build a Following With YouTube

Do you create YouTube videos? Want to increase your audience? To learn how to create an online community using YouTube, I interview Tim Schmoyer. More About This Show The Social Media Marketing podcast is an on-demand talk radio show from Social Media Examiner. It’s designed to help busy marketers and business owners discover what works with […]

This post YouTube Community Development: How to Build a Following With YouTube first appeared on Social Media Examiner.
Social Media Examiner - Your Guide to the Social Media Jungle


by Michael Stelzner via Social Media Examiner