This is my code:
- script src="url//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" - /script
- script src="my url/jquery.zrssfeed.min.js" type="text/javascript" - /script
- script type="text/javascript"
- $(document).ready(function () {
- $('#name_a').rssfeed('feed url/rss', {
- limit: 1,
- offset: 1,
- header: false,
- date: false,
- content: false,
- snippet: true
- }, function(e) {
- $('h4 a',e).each(function(i) {
- var title = $(this).text();
- if (title.length > 4) $(this).text(title.substring(0,4))
- });
- $('#name_a h4 a').each(function() {
- var $link = $(this);
- $link.after($link.text());
- $link.remove();
- });
- });
- });
- $(document).ready(function () {
- $('#name_a_avg').rssfeed('feed url/rss', {
- limit: 1,
- offset: 1,
- header: false,
- date: false,
- content: false,
- snippet: true
- }, function(e) {
- $('h4 a',e).each(function(i) {
- var title = $(this).text();
- if (title.length > 40) $(this).text(title.substring(33,40))
- });
- $('#name_a_avg h4 a').each(function() {
- var $link = $(this);
- $link.after($link.text());
- $link.remove();
- });
- });
- });
- $(document).ready(function () {
- $('#name_d').rssfeed('feed url/rss', {
- limit: 1,
- offset: 4,
- header: false,
- date: false,
- content: false,
- snippet: true
- }, function(e) {
- $('h4 a',e).each(function(i) {
- var title = $(this).text();
- if (title.length > 6) $(this).text(title.substring(0,6))
- });
- $('#name_d h4 a').each(function() {
- var $link = $(this);
- $link.after($link.text());
- $link.remove();
- });
- });
- });
- $(document).ready(function () {
- $('#name_d_avg').rssfeed('feed url/rss', {
- limit: 1,
- offset: 4,
- header: false,
- date: false,
- content: false,
- snippet: true
- }, function(e) {
- $('h4 a',e).each(function(i) {
- var title = $(this).text();
- if (title.length > 40) $(this).text(title.substring(35,40))
- });
- $('#name_d_avg h4 a').each(function() {
- var $link = $(this);
- $link.after($link.text());
- $link.remove();
- });
- });
- });
- /script
The rss feed comes in a different order everyday so I keep having to change my offset. How do I do sort alphabetically by their title - and output only the first and fourth ones?
This is the format of the rss listing incase it helps:
Shop Our Store for 'name_a' at url/Search/'name_a' 'name_a' date 'name_a_avg'
And please be gentle I really am trying to learn and not simply cut and paste...answers I've gotten elsewhere simply didn't work at best, or went so far over my head I simply could not implement them.