This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.RectF; | |
import android.graphics.Shader; | |
import com.squareup.picasso.Transformation; | |
public class CircleTransform implements Transformation { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Article currentArticle = getItem(position); | |
ImageView image = listItemView.findViewById(R.id.article_image); | |
if (currentArticle != null) { | |
Picasso.with(this.getContext()) | |
.load(currentArticle.getmImageUrl()) | |
.centerCrop() | |
.transform(new CircleTransform(50,0)) | |
.fit() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.squareup.picasso</groupId> | |
<artifactId>picasso</artifactId> | |
<version>(insert latest version)</version> | |
</dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.squareup.picasso:picasso:(insert latest version)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> { | |
ImageView bmImage; | |
public DownloadImageTask(ImageView bmImage) { | |
this.bmImage = bmImage; | |
} | |
protected Bitmap doInBackground(String... urls) { | |
String urldisplay = urls[0]; | |
Bitmap bmp = null; | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Article currentArticle = getItem(position); | |
ImageView image = listItemView.findViewById(R.id.article_image); | |
if (currentArticle != null) { | |
new DownloadImageTask(image).execute(currentArticle.getmImageUrl()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'colored' | |
# this is just a preview of what's to come - a proof of concept. | |
# it will be converted to a api-type library, gemified, and put in it's own repo | |
# for now, a cool way to experiment with amazon's data | |
query = 'ruby' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Written as part of https://www.scrapehero.com/how-to-scrape-amazon-product-reviews-using-python/ | |
from lxml import html | |
import json | |
import requests | |
import json,re | |
from dateutil import parser as dateparser | |
from time import sleep |
NewerOlder